/**
 * SuperStorage SocialEngine v2 - Main Stylesheet
 * Modern, clean design with navy/teal/emerald theme
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Navy / Teal / Emerald palette (matches landing page) */
  --navy-900: #0B1437;
  --navy-800: #111C44;
  --navy-700: #1B254B;
  --teal-500: #0EA5E9;
  --teal-400: #38BDF8;
  --teal-300: #7DD3FC;
  --emerald-500: #10B981;
  --emerald-400: #34D399;

  --primary-gradient: linear-gradient(135deg, var(--navy-900), var(--teal-500));
  --primary-color: #0EA5E9;
  --secondary-color: #0891B2;
  --accent-gradient: linear-gradient(135deg, var(--teal-500), #0891B2);
  --success-color: #22C55E;
  --danger-color: #EF4444;
  --warning-color: #FBBF24;
  --info-color: #3B82F6;
  --text-color: #1E293B;
  --text-light: #64748B;
  --border-color: #E2E8F0;
  --bg-light: #F8FAFC;
  --bg-white: #FFFFFF;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: var(--text-color);
  line-height: 1.6;
}

/* ============ HEADER ============ */

header {
  background: rgba(11, 20, 55, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  padding: 0.75rem 2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* Header stats (legacy — now hidden in header, shown in Overview) */
.header-stats-row {
  display: none;
}
.header-stat {
  display: none;
}

/* Legacy stat-item (used in analytics/overview cards) */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-item strong {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-item span {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============ MAIN CONTAINER ============ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* ============ NAVIGATION TABS ============ */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* ============ BUTTONS ============ */

.btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-info {
  background: var(--info-color);
  color: white;
}

.btn-info:hover {
  opacity: 0.9;
}

.rewrite-instructions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.rewrite-instructions-input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  color: var(--text-color);
  background: var(--bg-white);
}

.rewrite-instructions-input::placeholder {
  color: #9CA3AF;
  font-size: 0.82rem;
}

.rewrite-instructions-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.btn-rewrite-inline {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* A/B Variants Panel (5.6) */
.variants-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #0D948830;
  border-radius: 0.5rem;
  background: #0D948808;
}

.variant-card {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  background: var(--bg-white);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.variant-card:hover {
  border-color: #0D9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.12);
}

.variant-card:last-child {
  margin-bottom: 0;
}

.variant-hook-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0D9488;
  background: #0D948815;
  border: 1px solid #0D948830;
  padding: 1px 6px;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.variant-caption-preview {
  font-size: 0.82rem;
  color: var(--text-color);
  line-height: 1.4;
}

.variant-meta {
  font-size: 0.72rem;
  color: #9CA3AF;
  margin-top: 0.3rem;
}

.variant-loading {
  text-align: center;
  padding: 1.5rem;
  color: #9CA3AF;
  font-size: 0.85rem;
}

.btn-warning {
  background: var(--warning-color);
  color: var(--text-color);
}

.btn-warning:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* ============ WEEK SELECTOR ============ */

/* ============ GENERATE CONTROLS TOOLBAR ============ */
.calendar-toolbar {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, #F0FDFA, #F0F9FF);
  border: 1px solid #CFFAFE;
  border-radius: 0.75rem;
}

.generate-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.generate-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  white-space: nowrap;
}

.generate-duration-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #A5F3FC;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-family: inherit;
  background: white;
  color: #1F2937;
  cursor: pointer;
  min-width: 200px;
}

.generate-duration-select:focus {
  outline: none;
  border-color: #0EA5E9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Facility picker dropdown */
.facility-picker-wrapper {
  position: relative;
}

.facility-picker-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #A5F3FC;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: white;
  color: #1F2937;
  cursor: pointer;
  white-space: nowrap;
  min-width: 140px;
  text-align: left;
}

.facility-picker-btn:hover {
  border-color: #0EA5E9;
}

.facility-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  background: white;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
}

.facility-picker-dropdown.open {
  display: block;
}

.fac-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.83rem;
  cursor: pointer;
  white-space: nowrap;
}

.fac-check-item:hover {
  background: #F3F4F6;
}

.fac-check-item input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.fac-check-divider {
  height: 1px;
  background: #E5E7EB;
  margin: 4px 0;
}

.generate-btn {
  white-space: nowrap;
  font-size: 0.88rem;
}

.generate-stop-btn {
  background: #EF4444;
  color: white;
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.generate-stop-btn:hover {
  background: #DC2626;
}

.generate-spacer {
  flex: 1;
}

.generate-clear-btn {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.generate-clear-btn:hover {
  background: #FEE2E2;
  border-color: #F87171;
}

/* ============ WEEK SELECTOR ============ */
.week-selector {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.week-btn {
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--border-color);
  background: var(--bg-white);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-color);
}

.week-btn:hover {
  border-color: var(--primary-color);
}

.week-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

/* ============ CALENDAR GRID ============ */

.calendar-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.grid-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 0.5rem;
}

.grid-cell {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 0.5rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.header-row .grid-cell {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  min-height: auto;
  padding: 1rem;
}

.facility-cell {
  font-weight: 600;
  color: var(--text-color);
}

.grid-cell:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.post-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.preview-text {
  font-size: 0.85rem;
  color: var(--text-color);
  flex: 1;
  line-height: 1.4;
}

/* ============ BADGES ============ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pillar-badge {
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  width: fit-content;
}

.status-badge {
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  width: fit-content;
}

.hashtag {
  display: inline-block;
  background: var(--bg-light);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

/* ============ SCHEDULING CALENDAR ============ */

.sc-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.sc-controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sc-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sc-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
}

.sc-toggle-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.sc-toggle-btn:first-child {
  border-right: 1px solid var(--border);
}

.sc-toggle-btn.active {
  background: var(--primary);
  color: white;
}

.sc-toggle-btn:hover:not(.active) {
  background: var(--bg-light);
}

.sc-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sc-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}

.sc-nav-btn:hover {
  background: var(--bg-light);
}

.sc-nav-label {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 140px;
  text-align: center;
}

.sc-nav-today {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: white;
  cursor: pointer;
  font-family: inherit;
}

.sc-nav-today:hover {
  background: var(--bg-light);
}

.sc-filter {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: white;
  font-family: inherit;
}

.sc-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sc-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.sc-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.sc-empty h3 {
  margin-bottom: 0.5rem;
  color: #374151;
}

.sc-empty p {
  color: #6B7280;
}

/* ---- Month View ---- */

.sc-month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 2px solid var(--border);
}

.sc-month-day-name {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sc-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.sc-month-cell {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.3rem;
  background: white;
  transition: background 0.15s;
}

.sc-month-cell.sc-other-month {
  background: #FAFAFA;
}

.sc-month-cell.sc-other-month .sc-date-num {
  color: #D1D5DB;
}

.sc-month-cell.sc-today {
  background: #EFF6FF;
}

.sc-month-cell.sc-drop-hover {
  background: #DBEAFE !important;
  outline: 2px dashed #3B82F6;
  outline-offset: -2px;
}

.sc-date-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 0.2rem;
  padding: 0.1rem 0.3rem;
}

.sc-today .sc-date-num {
  background: #3B82F6;
  color: white;
  border-radius: 999px;
  display: inline-block;
  width: 22px;
  height: 22px;
  text-align: center;
  line-height: 22px;
  padding: 0;
}

.sc-day-posts {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ---- Compact Pill (month view) ---- */

.sc-compact-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  cursor: grab;
  font-size: 0.65rem;
  transition: background 0.12s;
  user-select: none;
  overflow: hidden;
}

.sc-compact-pill:hover {
  background: #EFF6FF;
  border-color: #DBEAFE;
}

.sc-compact-pill.sc-dragging {
  opacity: 0.4;
}

.sc-compact-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sc-compact-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4B5563;
  font-weight: 500;
}

.sc-compact-check {
  color: #10B981;
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}

.sc-more-btn {
  font-size: 0.6rem;
  color: #3B82F6;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  font-weight: 500;
  text-align: center;
}

.sc-more-btn:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ---- Post Pill (week view) ---- */

.sc-pill {
  background: white;
  border: 1px solid #E5E7EB;
  border-left: 3px solid #6B7280;
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  cursor: grab;
  font-size: 0.7rem;
  transition: box-shadow 0.15s, opacity 0.15s;
  user-select: none;
}

.sc-pill:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 1;
}

.sc-pill.sc-dragging {
  opacity: 0.4;
}

.sc-pill-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}

.sc-pill-pillar {
  color: white;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.sc-pill-status {
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.sc-pill-caption {
  font-size: 0.7rem;
  color: #374151;
  line-height: 1.3;
  margin: 0.2rem 0;
  word-break: break-word;
}

.sc-pill-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.15rem;
}

.sc-pill-facility {
  font-size: 0.6rem;
  color: #9CA3AF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.sc-pill-actions {
  display: flex;
  gap: 0.2rem;
}

.sc-quick-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 3px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.1s;
}

.sc-quick-btn:hover {
  transform: scale(1.15);
}

.sc-approve {
  background: #D1FAE5;
  color: #059669;
}

.sc-reject {
  background: #FEE2E2;
  color: #DC2626;
}

/* ---- Week View (facility timeline) ---- */

.sc-week-header {
  display: grid;
  grid-template-columns: 160px repeat(7, 1fr);
  border-bottom: 2px solid var(--border);
  background: #F9FAFB;
  border-radius: 0.5rem 0.5rem 0 0;
}

.sc-week-facility-col {
  padding: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.sc-week-day-col {
  padding: 0.5rem;
  text-align: center;
  border-left: 1px solid var(--border);
}

.sc-week-day-col.sc-today-col {
  background: #EFF6FF;
}

.sc-week-day-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
}

.sc-week-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.sc-week-day-num.sc-today-num {
  background: #3B82F6;
  color: white;
  border-radius: 999px;
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
}

.sc-week-grid {
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.sc-week-row {
  display: grid;
  grid-template-columns: 160px repeat(7, 1fr);
  min-height: 70px;
}

.sc-week-facility-label {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sc-week-facility-label strong {
  font-size: 0.8rem;
}

.sc-week-facility-label small {
  color: #9CA3AF;
  font-size: 0.7rem;
}

.sc-week-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: white;
  min-height: 60px;
  transition: background 0.15s;
}

.sc-week-cell.sc-today-cell {
  background: #F0F7FF;
}

.sc-week-cell.sc-drop-hover {
  background: #DBEAFE !important;
  outline: 2px dashed #3B82F6;
  outline-offset: -2px;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .sc-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .sc-month-cell {
    min-height: 70px;
  }

  .sc-pill-pillar {
    max-width: 55px;
  }

  .sc-pill-facility {
    display: none;
  }

  .sc-week-row {
    grid-template-columns: 100px repeat(7, 1fr);
  }

  .sc-week-header {
    grid-template-columns: 100px repeat(7, 1fr);
  }

  .sc-week-facility-label strong {
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .sc-month-grid {
    font-size: 0.65rem;
  }

  .sc-pill-top {
    flex-wrap: wrap;
  }

  .sc-nav-label {
    min-width: 100px;
    font-size: 0.8rem;
  }
}

/* ============ QUEUE LIST ============ */

/* ============ APPROVAL QUEUE V2 ============ */

.queue-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.queue-filter-tabs {
  display: flex;
  gap: 0.35rem;
  background: #F3F4F6;
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.queue-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s;
}

.queue-filter-btn:hover { color: #374151; background: #E5E7EB; }

.queue-filter-btn.active {
  background: white;
  color: #1F2937;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

.queue-count {
  font-size: 0.72rem;
  background: #E5E7EB;
  color: #6B7280;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-weight: 700;
  min-width: 1.2rem;
  text-align: center;
}

.queue-filter-btn.active .queue-count { background: #0EA5E9; color: white; }
.queue-count-approved { background: #D1FAE5; color: #065F46; }
.queue-count-rejected { background: #FEE2E2; color: #991B1B; }

.queue-bulk-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.queue-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6B7280;
}
.queue-empty span { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.queue-empty h3 { color: #374151; margin-bottom: 0.25rem; }
.queue-empty p { font-size: 0.9rem; }

/* Facility groups */
.queue-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.queue-facility-group {
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  overflow: hidden;
}

.queue-facility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #F9FAFB, #F3F4F6);
  border-bottom: 1px solid #E5E7EB;
}

.queue-facility-header strong { font-size: 0.95rem; color: #1F2937; }

.queue-facility-count {
  font-size: 0.78rem;
  color: #9CA3AF;
  font-weight: 500;
}

.queue-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0;
}

/* Individual queue card */
.queue-card-v2 {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.15s;
}

.queue-card-v2:last-child { border-bottom: none; }
.queue-card-v2:hover { background: #FAFBFF; }

.qv2-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.qv2-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qv2-date {
  font-size: 0.78rem;
  color: #9CA3AF;
  font-weight: 500;
}

.qv2-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.qv2-body {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.qv2-content { flex: 1; min-width: 0; }

.qv2-fb-snippet {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  padding: 0.65rem;
}

.qv2-fb-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.qv2-fb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.qv2-fb-name { font-size: 0.78rem; font-weight: 600; color: #1F2937; }
.qv2-fb-time { font-size: 0.65rem; color: #9CA3AF; }

.qv2-caption {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #374151;
  margin: 0;
}

.qv2-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.queue-hashtag {
  font-size: 0.68rem;
  color: #0EA5E9;
  font-weight: 500;
}

.qv2-image {
  width: 80px;
  height: 80px;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
  background: #F3F4F6;
}

.qv2-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qv2-image-suggestion {
  width: 80px;
  min-height: 60px;
  background: #F0F9FF;
  border: 1px dashed #A5F3FC;
  border-radius: 0.5rem;
  padding: 0.4rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.qv2-img-icon { font-size: 1rem; margin-bottom: 0.15rem; }

.qv2-image-suggestion small {
  font-size: 0.58rem;
  color: #6B7280;
  line-height: 1.2;
}

.qv2-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qv2-action-group {
  display: flex;
  gap: 0.35rem;
}

.qv2-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid #D1D5DB;
  background: white;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: #374151;
}

.qv2-btn:hover { background: #F9FAFB; }

.qv2-btn-edit { color: #0C4A6E; border-color: #A5F3FC; }
.qv2-btn-edit:hover { background: #F0F9FF; }

.qv2-btn-approve { color: #059669; border-color: #A7F3D0; }
.qv2-btn-approve:hover { background: #ECFDF5; }

.qv2-btn-reject { color: #DC2626; border-color: #FECACA; }
.qv2-btn-reject:hover { background: #FEF2F2; }

/* Legacy compat — keep old bulk-actions for settings tab usage */
.bulk-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  flex-wrap: wrap;
}

.action-info {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-left: auto;
}

/* ============ MODAL ============ */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-white);
  margin: 5vh auto;
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
  .modal-content {
    grid-template-columns: 1fr;
    margin: 2rem;
  }
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-close:hover {
  color: var(--text-color);
}

.modal-left, .modal-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.modal-header p {
  font-size: 0.95rem;
  color: var(--text-light);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s ease;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.modal-status {
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.375rem;
  border-left: 4px solid var(--primary-color);
}

.modal-status strong {
  display: block;
  margin-bottom: 0.25rem;
}

.char-count {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Hashtag editor in post modal */
.hashtag-edit-group {
  gap: 0.3rem !important;
}

.hashtag-edit-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #0F766E;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.hashtag-edit-input::placeholder {
  color: #A5F3FC;
}

.hashtag-edit-input:focus {
  outline: none;
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.hashtag-count {
  font-size: 0.8rem;
  color: var(--text-light);
}

.modal-actions {
  display: grid;
  gap: 0.75rem;
}

.rewrite-section {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  border: 2px dashed var(--primary-color);
}

@media (max-width: 768px) {
  .rewrite-section {
    grid-column: 1;
  }
}

.rewrite-section h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.preview-box {
  padding: 1rem;
  background: var(--bg-white);
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 100px;
}

.preview-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  display: block;
}

/* ============ IMAGE SECTION (Post Modal) ============ */

.image-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.hashtag-suggestion {
  background: linear-gradient(135deg, #F0FFF4 0%, #F0F9FF 100%);
  border: 1px solid #86EFAC;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.hashtag-suggestion .hashtag-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  border-radius: 1rem;
  font-size: 0.8rem;
  color: #065F46;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.hashtag-suggestion .hashtag-chip:hover {
  background: #D1FAE5;
  border-color: #34D399;
}

.hashtag-suggestion .hashtag-chip.added {
  background: #D1FAE5;
  border-color: #34D399;
  opacity: 0.5;
  cursor: default;
}

.image-suggestion {
  background: linear-gradient(135deg, #F0F9FF 0%, #FDF2F8 100%);
  border: 1px solid #A5F3FC;
  border-radius: 0.5rem;
  padding: 1rem;
}

.image-suggestion-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.image-suggestion-header strong {
  font-size: 0.9rem;
  color: var(--primary-color);
}

.image-suggestion-icon {
  font-size: 1.1rem;
}

.image-suggestion-text {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  width: 100%;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  resize: vertical;
  background: white;
  transition: border-color 0.15s;
}

.image-suggestion-text:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.image-suggestion-meta {
  margin-bottom: 0.25rem;
}

.image-suggestion-style {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.gemini-prompt-details {
  margin-top: 0.5rem;
}

.gemini-prompt-details summary {
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}

.gemini-prompt-details summary:hover {
  color: var(--primary-color);
}

.gemini-prompt-text {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-light);
  max-height: 150px;
  overflow-y: auto;
  font-family: 'Inter', monospace;
  line-height: 1.4;
}

/* Gemini action buttons */
.gemini-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-gemini {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gemini-generate {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-gemini-generate:hover {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4294 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.btn-gemini-edit {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
}

.btn-gemini-edit:hover {
  background: linear-gradient(135deg, #e080e8 0%, #e0475c 100%);
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.35);
}

.btn-email-suggestion {
  background: #F3F4F6;
  color: #374151;
  border: 1px solid #D1D5DB;
}

.btn-email-suggestion:hover {
  background: #E5E7EB;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gemini-btn-icon {
  font-size: 0.9rem;
}

/* Gemini progress spinner */
.gemini-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #f0f0ff;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  color: #667eea;
  font-weight: 500;
}

.gemini-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #ddd;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: geminiSpin 0.8s linear infinite;
}

@keyframes geminiSpin {
  to { transform: rotate(360deg); }
}

/* Gemini error message */
.gemini-error {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  color: #dc2626;
}

.image-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.image-upload-area.drag-over {
  border-color: var(--primary-color);
  background: rgba(14, 165, 233, 0.05);
}

.image-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}

.image-upload-prompt:hover {
  background: rgba(14, 165, 233, 0.04);
}

.upload-icon {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.image-upload-prompt p {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.image-upload-prompt small {
  font-size: 0.8rem;
  color: var(--text-light);
}

.image-preview-container {
  position: relative;
}

.image-preview {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
  border-radius: 0.375rem;
  background: #F3F4F6;
}

.btn-remove-image {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.btn-remove-image:hover {
  background: var(--danger-color);
}


.image-upload-status {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

.image-upload-status.uploading {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.image-upload-status.success {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.image-upload-status.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.image-upload-status.warning {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* ============ IMAGE LIBRARY SUGGESTIONS ============ */

.image-library-suggest {
  margin-top: 0.75rem;
}

.btn-library-suggest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
  color: #4338CA;
  border: 1px solid #A5F3FC;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.btn-library-suggest:hover {
  background: linear-gradient(135deg, #E0F2FE, #A5F3FC);
  border-color: #A5B4FC;
}

.btn-library-suggest:disabled {
  opacity: 0.6;
  cursor: wait;
}

.library-icon {
  font-size: 1rem;
}

.library-gallery {
  margin-top: 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.library-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.85rem;
}

.btn-close-gallery {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.btn-close-gallery:hover {
  color: #4B5563;
}

.library-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.library-gallery-item {
  border: 2px solid #E5E7EB;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: #F9FAFB;
}

.library-gallery-item:hover {
  border-color: #0EA5E9;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
}

.library-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #F3F4F6;
}

.library-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-item-info {
  padding: 0.35rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.library-score {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.library-score.score-great { color: #059669; }
.library-score.score-good { color: #D97706; }
.library-score.score-fair { color: #6B7280; }

.library-reasons {
  font-size: 0.65rem;
  color: #9CA3AF;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-browse-all-wrap {
  padding: 0.5rem 0.75rem 0.75rem;
  text-align: center;
  border-top: 1px solid #E5E7EB;
}

.btn-browse-all-library {
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: #F3F4F6;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-browse-all-library:hover {
  background: #E5E7EB;
  border-color: #9CA3AF;
}

.library-full-browser {
  padding: 0;
}

.library-full-browser-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.9rem;
}

.library-full-grid {
  max-height: 400px;
  overflow-y: auto;
}

.library-full-grid .library-gallery-item .library-item-info {
  padding: 0.25rem 0.4rem;
}

.library-full-grid .library-gallery-item .library-item-filename {
  font-size: 0.7rem;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  color: #9CA3AF;
}

.library-gallery-empty span {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.library-gallery-empty p {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6B7280;
  margin: 0 0 0.25rem;
}

.library-gallery-empty small {
  font-size: 0.8rem;
}

.library-gallery-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #6B7280;
  font-size: 0.9rem;
}

/* ============ AI ENHANCE LIBRARY SUGGESTIONS ============ */

.library-gallery-item.enhanceable {
  border-color: #67E8F9;
  background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
}

.library-gallery-item.enhanceable:hover {
  border-color: #0D9488;
  box-shadow: 0 2px 12px rgba(13, 148, 136, 0.25);
}

.enhance-overlay-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(13, 148, 136, 0.85);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.library-enhance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: #0D9488;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

.enhance-sparkle {
  font-size: 0.7rem;
  line-height: 1;
}

.btn-library-enhance {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  border: none;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-library-enhance:hover {
  background: linear-gradient(135deg, #0F766E 0%, #134E4A 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.btn-library-enhance:active {
  transform: translateY(0);
}

.btn-library-enhance .enhance-sparkle {
  font-size: 0.65rem;
}

/* ============ GEMINI RESULT CONFIRMATION BAR ============ */

.gemini-result-bar {
  border: 2px solid #67E8F9;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
}

.gemini-result-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F766E;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.gemini-result-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-gemini-save {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: #059669;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-gemini-save:hover {
  background: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-gemini-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-gemini-discard {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6B7280;
  background: #F3F4F6;
  border: 1px solid #D1D5DB;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-gemini-discard:hover {
  background: #E5E7EB;
  color: #EF4444;
  border-color: #EF4444;
}

.gemini-revise-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

.gemini-revise-input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #A5F3FC;
  border-radius: 0.4rem;
  background: #fff;
  color: #1F2937;
  outline: none;
  transition: border-color 0.2s;
}

.gemini-revise-input::placeholder {
  color: #9CA3AF;
  font-size: 0.75rem;
}

.gemini-revise-input:focus {
  border-color: #0D9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.btn-gemini-revise {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-gemini-revise:hover {
  background: linear-gradient(135deg, #0F766E 0%, #134E4A 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* ============ SOCIAL MEDIA PREVIEW ============ */

.social-preview-section {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0.5rem;
  background: #F9FAFB;
  border-radius: 0.75rem;
  border: 1px solid #E5E7EB;
}

@media (max-width: 768px) {
  .social-preview-section {
    grid-column: 1;
  }
}

/* Preview button removed — live preview always visible */

/* btn-preview.active removed — preview always visible */

.social-preview-tabs {
  display: flex;
  gap: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}

.social-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  background: var(--bg-light);
  color: var(--text-light);
}

.social-tab.active {
  background: var(--primary-gradient);
  color: white;
}

.social-tab:hover:not(.active) {
  background: #F0F9FF;
}

/* ----- Facebook Preview ----- */

.social-preview-card {
  border-radius: 0.5rem;
  border: 1px solid #D1D5DB;
  overflow: hidden;
  background: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-shrink: 0;
}

.fb-preview {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fb-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
}

.fb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0EA5E9, #0891B2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.fb-meta {
  flex: 1;
}

.fb-page-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #050505;
}

.fb-location-name {
  font-weight: 400;
  color: #65676B;
}

.fb-timestamp {
  font-size: 0.75rem;
  color: #65676B;
}

.fb-more {
  color: #65676B;
  font-size: 1.2rem;
  cursor: default;
}

.fb-caption {
  padding: 0 0.75rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #050505;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.fb-image-container {
  width: 100%;
  background: #F0F2F5;
}

.fb-image {
  width: 100%;
  height: auto;
  display: block;
}

.fb-engagement {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #65676B;
}

.fb-divider {
  height: 1px;
  background: #E4E6EB;
  margin: 0 0.75rem;
}

.fb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 0.25rem 0.5rem;
}

.fb-action {
  background: none;
  border: none;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #65676B;
  cursor: default;
  border-radius: 0.375rem;
  font-family: inherit;
  text-align: center;
}

/* ----- Instagram Preview ----- */

.ig-preview {
  border: 1px solid #DBDBDB;
  border-radius: 0.5rem;
}

.ig-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #EFEFEF;
}

.ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.ig-username {
  font-weight: 600;
  font-size: 0.85rem;
  color: #262626;
  flex: 1;
}

.ig-more {
  color: #262626;
  cursor: default;
}

.ig-image-container {
  width: 100%;
  aspect-ratio: 1;
  background: #FAFAFA;
  overflow: hidden;
}

.ig-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #C7C7C7;
  gap: 0.5rem;
}

.ig-image-placeholder span {
  font-size: 2.5rem;
}

.ig-image-placeholder small {
  font-size: 0.8rem;
}

.ig-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ig-actions {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 1.3rem;
}

.ig-actions-left {
  display: flex;
  gap: 0.75rem;
}

.ig-likes {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 0.75rem;
  color: #262626;
}

.ig-caption {
  padding: 0.25rem 0.75rem 0.25rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #262626;
}

.ig-caption-username {
  font-weight: 600;
}

.ig-caption-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ig-hashtags {
  padding: 0.1rem 0.75rem 0.25rem;
  font-size: 0.85rem;
  color: #00376B;
  line-height: 1.4;
}

.preview-hashtags {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #0EA5E9;
  line-height: 1.6;
  word-wrap: break-word;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  border-radius: 0 0 0.75rem 0.75rem;
}

.preview-hashtags:empty {
  display: none;
}

.modal-subtitle-pillar {
  display: inline-block;
  background: #F0F9FF;
  color: #0C4A6E;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.ig-timestamp {
  padding: 0.25rem 0.75rem 0.6rem;
  font-size: 0.65rem;
  color: #8E8E8E;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

/* ============ PUBLISHING / ANALYTICS ============ */

.export-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: var(--bg-white);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  text-align: center;
}

.stat-item strong {
  display: block;
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-item span {
  font-size: 0.9rem;
  color: var(--text-light);
}

.approved-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.approved-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.approved-card:hover {
  box-shadow: var(--shadow-md);
}

.approved-card-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.approved-card-header strong {
  flex: 1;
  min-width: 150px;
}

.approved-card-content {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.375rem;
}

.approved-card-schedule {
  font-size: 0.95rem;
  color: var(--text-light);
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.approved-card-schedule strong {
  color: var(--text-color);
}

/* ============ PUBLISHED HISTORY ============ */
.published-history-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.published-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.published-history-header h3 {
  font-size: 1.125rem;
  color: var(--text-color);
  margin: 0;
}

.published-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.published-history-loading {
  text-align: center;
  padding: 2rem;
}

.published-history-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
}

.published-history-empty span {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.published-history-empty p {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.published-history-empty small {
  font-size: 0.8rem;
  color: #9CA3AF;
}

.ph-date-group {
  margin-bottom: 1.5rem;
}

.ph-date-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.ph-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  margin-bottom: 0.5rem;
  transition: box-shadow 0.15s;
}

.ph-card:hover {
  box-shadow: var(--shadow-sm);
}

.ph-status-success {
  border-left: 3px solid var(--success-color);
}

.ph-status-failed {
  border-left: 3px solid var(--danger-color);
  background: #FEF2F2;
}

.ph-card-left {
  flex-shrink: 0;
}

.ph-thumb {
  width: 48px;
  height: 48px;
  border-radius: 0.375rem;
  object-fit: cover;
}

.ph-thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 0.375rem;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ph-card-body {
  flex: 1;
  min-width: 0;
}

.ph-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.ph-facility {
  font-size: 0.9rem;
  color: var(--text-color);
}

.ph-card-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.ph-pillar {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  color: white;
  font-weight: 500;
}

.ph-platform {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  background: #E0F2FE;
  color: #4338CA;
  font-weight: 500;
}

.ph-caption {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.35;
  margin: 0;
}

.ph-error {
  font-size: 0.78rem;
  color: var(--danger-color);
  margin: 0.25rem 0 0;
}

.ph-card-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 80px;
}

.ph-status-icon {
  font-size: 1.1rem;
}

.ph-status-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
}

.ph-time {
  font-size: 0.72rem;
  color: #9CA3AF;
}

.ph-link {
  font-size: 0.75rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.15rem;
}

.ph-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .ph-card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .ph-card-right {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: unset;
  }

  .ph-card-left {
    display: none;
  }
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.analytics-card h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.stat-bar {
  margin-bottom: 1rem;
}

.bar-item {
  height: 30px;
  border-radius: 0.25rem;
  overflow: hidden;
  display: flex;
}

.stat-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.stat-list {
  list-style: none;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.stat-list li:last-child {
  border-bottom: none;
}

.stat-list strong {
  color: var(--primary-color);
}

.analytics-note {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #92400E;
  font-size: 0.95rem;
}

/* ============ REAL ANALYTICS ============ */

.analytics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.analytics-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.analytics-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--bg-white);
  color: var(--text-color);
  cursor: pointer;
}

.analytics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: #6B7280;
}

.analytics-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 1rem;
}

.analytics-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 0.5rem;
  padding: 1.5rem;
  color: #991B1B;
}

.analytics-error strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.analytics-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6B7280;
}

.analytics-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.analytics-empty-state h3 {
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

/* KPI Row */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.analytics-kpi {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.25rem 1rem;
  text-align: center;
}

.kpi-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.kpi-label {
  display: block;
  font-size: 0.8rem;
  color: #6B7280;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Analytics Table */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.analytics-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: #6B7280;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #F3F4F6;
}

.analytics-table tbody tr:hover {
  background: #F9FAFB;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.5rem;
}

.analytics-card-full {
  grid-column: 1 / -1;
}

/* Post list inside analytics */
.analytics-posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.analytics-post-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  border-bottom: 1px solid #F3F4F6;
  border-radius: 8px;
  position: relative;
  transition: background 0.15s;
}

.analytics-post-clickable {
  cursor: pointer;
}

.analytics-post-clickable:hover {
  background: #F0F9FF;
}

.post-item-link {
  position: absolute;
  right: 0.75rem;
  bottom: 0.5rem;
  font-size: 0.75rem;
  color: #3B82F6;
  opacity: 0;
  transition: opacity 0.15s;
}

.analytics-post-clickable:hover .post-item-link {
  opacity: 1;
}

.analytics-post-item:last-child {
  border-bottom: none;
}

.post-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-facility-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-item-caption {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.4;
}

.post-item-date {
  font-size: 0.8rem;
  color: #9CA3AF;
}

.post-item-metrics {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #6B7280;
  white-space: nowrap;
}

.post-item-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Deep post metrics row */
.post-item-deep-metrics {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px dashed #E5E7EB;
}
.post-item-deep-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.deep-metric-neg {
  color: #EF4444;
}
.post-type-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.post-type-video {
  background: #DBEAFE;
  color: #1D4ED8;
}

/* ============ NOTIFICATIONS ============ */

.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  z-index: 10001;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notification.fade-out {
  animation: slideOutRight 0.3s ease;
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

.notification-success {
  background: var(--success-color);
}

.notification-danger {
  background: var(--danger-color);
}

.notification-info {
  background: var(--info-color);
}

.notification-warning {
  background: var(--warning-color);
  color: var(--text-color);
}

.notification-error {
  background: var(--danger-color);
}

/* ── Offline Banner ── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ── Retry indicator on cards ── */
.retry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.retry-badge.retry-failed {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header-container {
    flex-wrap: wrap;
  }

  .header-title {
    font-size: 1rem;
  }

  /* header stats removed from header — now in Overview only */

  .tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  .grid-row {
    grid-template-columns: 150px 1fr;
  }

  .grid-cell {
    min-height: 100px;
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }

  .rewrite-section {
    grid-column: 1;
  }

  .queue-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .queue-filter-tabs { overflow-x: auto; }

  .queue-cards-grid {
    grid-template-columns: 1fr;
  }

  .qv2-body { flex-direction: column; }
  .qv2-image, .qv2-image-suggestion { width: 100%; height: 120px; }
  .qv2-actions { flex-direction: column; gap: 0.5rem; }
  .qv2-action-group { width: 100%; }
  .qv2-btn { flex: 1; text-align: center; }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-post-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-item-metrics {
    flex-wrap: wrap;
  }

  .notification {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.5rem 1rem;
  }

  .header-title {
    font-size: 0.9rem;
  }

  /* header stats removed from header */

  .tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .tab-btn {
    flex-shrink: 0;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* ============ CONTENT INTELLIGENCE ============ */

.ci-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ci-header h3 {
  margin: 0;
}

.ci-badge {
  background: #F0F9FF;
  color: #0C4A6E;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Recommendations */
.ci-recs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ci-rec {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border-left: 3px solid #E5E7EB;
  background: #FAFAFA;
}

.ci-rec-high {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

.ci-rec-medium {
  border-left-color: #F59E0B;
  background: #FFFBEB;
}

.ci-rec-low {
  border-left-color: #6B7280;
  background: #F9FAFB;
}

.ci-rec-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ci-rec-body {
  flex: 1;
  min-width: 0;
}

.ci-rec-title {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.ci-rec-detail {
  font-size: 0.82rem;
  color: #6B7280;
  margin: 0;
  line-height: 1.45;
}

.ci-rec-priority {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.ci-priority-high {
  background: #FEE2E2;
  color: #991B1B;
}

.ci-priority-medium {
  background: #FEF3C7;
  color: #92400E;
}

.ci-priority-low {
  background: #F3F4F6;
  color: #6B7280;
}

/* Suggested Content Mix Bar */
.ci-weights-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #E5E7EB;
}

.ci-weights-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #374151;
}

.ci-weights-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
}

.ci-weight-segment {
  transition: flex 0.3s ease;
  min-width: 4px;
}

.ci-weights-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #6B7280;
}

.ci-weight-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Weekly Report Modal */
.ci-report-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.ci-report-modal {
  background: white;
  border-radius: 0.75rem;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.ci-report-header {
  padding: 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
  border-radius: 0.75rem 0.75rem 0 0;
}

.ci-report-header h2 {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
}

.ci-report-period {
  font-size: 0.8rem;
  color: #6B7280;
  background: #F3F4F6;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.ci-report-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9CA3AF;
  padding: 0.25rem;
  line-height: 1;
}

.ci-report-close:hover {
  color: #374151;
}

.ci-report-body {
  padding: 1.5rem;
}

.ci-report-section {
  margin-bottom: 1.5rem;
}

.ci-report-section:last-child {
  margin-bottom: 0;
}

.ci-report-section h3 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem 0;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
  padding-bottom: 0.4rem;
}

.ci-report-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ci-report-highlights li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed #F3F4F6;
}

.ci-report-highlights li:last-child {
  border-bottom: none;
}

.ci-report-highlights li::before {
  content: "✓ ";
  color: #22C55E;
  font-weight: 700;
}

.ci-report-actions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ci-report-actions li {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  border-bottom: 1px dashed #F3F4F6;
}

.ci-report-actions li:last-child {
  border-bottom: none;
}

.ci-report-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #E5E7EB;
  text-align: center;
  color: #9CA3AF;
}

/* Responsive: Content Intelligence */
@media (max-width: 768px) {
  .ci-rec {
    flex-wrap: wrap;
  }

  .ci-rec-priority {
    margin-top: 0;
  }

  .ci-weights-legend {
    flex-direction: column;
  }

  .ci-report-overlay {
    padding: 1rem;
  }

  .ci-report-modal {
    max-height: 90vh;
  }
}

/* ============ UTILITIES ============ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-light);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============ SETTINGS TAB ============ */

.settings-header {
  margin-bottom: 1.5rem;
}

.settings-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.settings-header p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.settings-info-banner {
  background: linear-gradient(135deg, #F0F9FF 0%, #F0FDFA 100%);
  border: 1px solid #A5F3FC;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: #4338CA;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-info-banner::before {
  content: "i";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #0EA5E9;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============ Brand Tabs in Settings ============ */
.brand-tab-bar {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #E5E7EB;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.brand-tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6B7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.brand-tab:hover {
  color: #374151;
  background: #F9FAFB;
}

.brand-tab.active {
  color: #6C63FF;
  border-bottom-color: #6C63FF;
}

.brand-tab-org {
  font-size: 0.82rem;
  color: #9CA3AF;
}

.brand-tab-org:hover {
  color: #6B7280;
}

.brand-tab-org.active {
  color: #6C63FF;
  border-bottom-color: #6C63FF;
}

.brand-tab-content {
  min-height: 200px;
}

/* ============ Brand Configuration ============ */
.brand-config-section {
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.brand-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: #FAFAFE;
  transition: background 0.15s;
}

.brand-config-header:hover {
  background: #F3F4F6;
}

.brand-config-title h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-color);
}

.brand-config-subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.15rem;
  display: block;
}

.brand-config-arrow {
  font-size: 0.8rem;
  color: var(--text-light);
  transition: transform 0.2s;
}

.brand-config-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.5rem;
}

.brand-config-body.open {
  max-height: none;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid #F3F4F6;
}

.brand-section {
  margin-bottom: 1rem;
}

.brand-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-section-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin: 0 0 0.75rem 0;
}

/* Collapsible subsections inside Brand Configuration */
.brand-subsection {
  border: 1px solid var(--border-color, #E5E7EB);
  border-radius: 8px;
  overflow: hidden;
}

.brand-subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--bg-secondary, #F9FAFB);
  user-select: none;
}

.brand-subsection-header:hover {
  background: var(--bg-hover, #F3F4F6);
}

.brand-subsection-arrow {
  font-size: 0.75rem;
  color: var(--text-muted, #9CA3AF);
  transition: transform 0.2s ease;
}

.brand-subsection-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.brand-subsection-body.open {
  max-height: none;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-color, #E5E7EB);
}

/* Completion percentage badges */
.section-pct-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  margin-right: 10px;
}

.section-pct-badge.pct-complete {
  background: #D1FAE5;
  color: #065F46;
}

.section-pct-badge.pct-partial {
  background: #FEF3C7;
  color: #92400E;
}

.section-pct-badge.pct-empty {
  background: #FEE2E2;
  color: #991B1B;
}

.brand-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.brand-form-grid .span-2 {
  grid-column: span 2;
}

/* Voice & Tone fields — consistent, roomy layout */
.brand-voice-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.voice-field {
  display: flex;
  flex-direction: column;
}

.voice-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 2px;
}

.voice-field .field-desc {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.voice-field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 68px;
}

.brand-form-grid .form-group label,
.brand-section .form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.brand-form-grid input,
.brand-form-grid textarea,
.brand-section textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.brand-form-grid input:focus,
.brand-form-grid textarea:focus,
.brand-section textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Content Pillars editor */
.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pillar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}

.pillar-row .pillar-color,
.pillar-row-extended .pillar-color {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.pillar-row .pillar-name,
.pillar-row-extended .pillar-name {
  flex: 2;
  padding: 0.45rem 0.6rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.85rem;
}

.pillar-row .pillar-id,
.pillar-row-extended .pillar-id {
  flex: 1.5;
  padding: 0.45rem 0.6rem;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
  background: #F3F4F6;
}

.pillar-row .pillar-remove,
.pillar-row-extended .pillar-remove {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  transition: color 0.15s;
}

.pillar-row .pillar-remove:hover,
.pillar-row-extended .pillar-remove:hover {
  color: #EF4444;
}

.pillar-row-extended .pillar-description,
.pillar-row-extended .pillar-examples,
.pillar-row-extended .pillar-image-direction,
.pillar-row-extended .pillar-hashtags,
.pillar-row-extended .pillar-pct {
  padding: 0.4rem 0.6rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.85rem;
}

.pillar-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
  margin-top: 4px;
}

.trait-row input,
.audience-row textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
}

.btn-add-pillar {
  background: none;
  border: 1px dashed #D1D5DB;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.83rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-add-pillar:hover {
  background: #F0F9FF;
  border-color: var(--primary-color);
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #F3F4F6;
}

.brand-actions .save-hint {
  font-size: 0.8rem;
  color: #9CA3AF;
}

/* Facility list — clean table-like rows */
.facility-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.facility-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.5fr 1.8fr auto;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.15s;
  gap: 0.75rem;
}

.facility-row:last-child {
  border-bottom: none;
}

.facility-row:hover {
  background: #FAFAFE;
}

.facility-row.row-header {
  background: #F9FAFB;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  padding: 0.75rem 1.5rem;
  border-bottom: 2px solid #E5E7EB;
}

.facility-row .fac-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.9rem;
}

.facility-row .fac-name .fac-region {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

.facility-row .fac-cell {
  font-size: 0.85rem;
  color: #374151;
}

.facility-row .fac-promos {
  font-size: 0.8rem;
  color: #374151;
}

.facility-row .fac-promos .promo-tag {
  display: inline-block;
  background: #ECFDF5;
  color: #065F46;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: 0.25rem;
  margin-bottom: 0.2rem;
}

.facility-row .fac-actions .btn {
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
}

/* Facility Edit Panel — full-width inline panel below the row */
.facility-edit-panel {
  background: #FAFAFE;
  border-bottom: 1px solid #E5E7EB;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.facility-edit-panel.open {
  max-height: none;
  padding: 1.5rem 1.5rem 1.75rem;
}

.facility-edit-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.facility-edit-panel .panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.facility-edit-panel .panel-header .panel-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.facility-edit-panel .panel-header .panel-close:hover {
  background: #E5E7EB;
  color: var(--text-color);
}

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem 1.5rem;
}

.edit-form-grid .form-group {
  display: flex;
  flex-direction: column;
}

.edit-form-grid .form-group.span-2 {
  grid-column: span 2;
}

.edit-form-grid .form-group.span-3 {
  grid-column: span 3;
}

.edit-form-grid label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.edit-form-grid label small {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #9CA3AF;
}

.edit-form-grid input[type="text"],
.edit-form-grid textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.edit-form-grid input[type="text"]:focus,
.edit-form-grid textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.edit-form-grid textarea {
  resize: vertical;
  min-height: 56px;
}

.panel-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.panel-actions .btn {
  padding: 0.55rem 1.5rem;
  font-size: 0.85rem;
}

.panel-actions .save-hint {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-left: auto;
}

@media (max-width: 900px) {
  .facility-row {
    grid-template-columns: 1.5fr 1fr 1fr auto;
  }
  .facility-row .fac-promos,
  .facility-row .fac-cell:nth-child(4),
  .facility-row .fac-cell:nth-child(5),
  .facility-row .fac-cell:nth-child(6) {
    display: none;
  }
  .edit-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .edit-form-grid .form-group.span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .facility-row {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
  .facility-row .fac-cell {
    display: none;
  }
  .edit-form-grid {
    grid-template-columns: 1fr;
  }
  .edit-form-grid .form-group.span-2,
  .edit-form-grid .form-group.span-3 {
    grid-column: span 1;
  }
}

/* ============================================================
   IMAGE LIBRARY TAB
   ============================================================ */

.lib-page {
  max-width: 1200px;
}

.lib-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.lib-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.25rem;
}

.lib-subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0;
}

/* Breadcrumb */
.lib-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.lib-crumb {
  color: var(--text-light);
}

.lib-crumb.active {
  color: var(--text-dark);
  font-weight: 600;
}

.lib-crumb.clickable {
  color: var(--primary-color);
  cursor: pointer;
}

.lib-crumb.clickable:hover {
  text-decoration: underline;
}

.lib-crumb-sep {
  color: var(--text-light);
}

/* Folder grid (overview) */
.lib-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.lib-folder-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.lib-folder-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}

.lib-folder-brand {
  border-color: var(--secondary-color);
  background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
}

.lib-folder-brand:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2);
}

.lib-folder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.lib-folder-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.lib-folder-count {
  color: var(--text-light);
  font-size: 0.8rem;
}

.lib-folder-desc {
  color: var(--secondary-color);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Upload bar */
.lib-upload-bar {
  margin-bottom: 1.5rem;
}

.lib-upload-drop {
  border: 2px dashed var(--border-color);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-light);
}

.lib-upload-drop:hover,
.lib-upload-drop.drag-over {
  border-color: var(--primary-color);
  background: #F0FDFA;
}

.lib-upload-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.lib-upload-drop span {
  color: var(--text-dark);
  font-size: 0.95rem;
}

.lib-upload-drop small {
  display: block;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Image count */
.lib-image-count {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Image grid */
.lib-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.lib-image-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}

.lib-image-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lib-image-thumb {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--bg-light);
}

.lib-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lib-image-info {
  padding: 0.75rem;
}

.lib-image-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-image-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.lib-image-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lib-image-card:hover .lib-image-delete {
  opacity: 1;
}

.lib-image-delete:hover {
  background: var(--danger-color);
  color: white;
}

/* AI-tagged image indicators */
.lib-ai-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: var(--primary-color);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  letter-spacing: 0.03em;
  z-index: 1;
}

.lib-image-desc {
  display: block;
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 0.2rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-image-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.lib-tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--text-light);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.75rem;
  white-space: nowrap;
}

.lib-tag-more {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

/* Empty state */
.lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

.lib-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.lib-empty p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.lib-empty small {
  font-size: 0.85rem;
}

/* ---- Image Lightbox ---- */
.lib-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

.lib-lightbox-overlay.visible {
  opacity: 1;
}

.lib-lightbox {
  background: white;
  border-radius: 1rem;
  max-width: 900px;
  width: 92vw;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.lib-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lib-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lib-lightbox-body {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  max-height: 88vh;
}

.lib-lightbox-image {
  flex: 1 1 55%;
  min-width: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lib-lightbox-image img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.lib-lightbox-info {
  flex: 0 0 320px;
  padding: 1.5rem;
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
  background: var(--bg-light);
}

.lib-lightbox-filename {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 1.25rem 0;
  word-break: break-word;
}

.lib-lightbox-section {
  margin-bottom: 1.25rem;
}

.lib-lightbox-section label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.lib-lightbox-section p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.lib-lightbox-meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.lib-meta-label {
  color: var(--text-light);
  font-weight: 500;
}

.lib-lightbox-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.lib-pillar-badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
}

.lib-lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.lib-lightbox-tag {
  display: inline-block;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
}

.lib-lightbox-no-tags {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.lib-lightbox-notice {
  background: #FEF3CD;
  border: 1px solid #F0D86E;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.78rem;
  color: #856404;
  line-height: 1.4;
}

/* ---- Lightbox AI Edit Section ---- */

.lib-lightbox-edit-section {
  border-top: 2px solid #ECFEFF;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.lib-lightbox-edit-input {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1px solid #A5F3FC;
  border-radius: 0.4rem;
  background: #fff;
  color: #1F2937;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.lib-lightbox-edit-input::placeholder {
  color: #9CA3AF;
  font-size: 0.75rem;
}

.lib-lightbox-edit-input:focus {
  border-color: #0D9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.lib-lightbox-edit-prompt-row {
  margin-bottom: 0.5rem;
}

.lib-lightbox-edit-ref-row {
  margin-bottom: 0.5rem;
}

.lib-lightbox-ref-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #0F766E;
  cursor: pointer;
  font-weight: 600;
  padding: 0.3rem 0;
  transition: color 0.2s;
}

.lib-lightbox-ref-label:hover {
  color: #134E4A;
  text-decoration: underline;
}

.ref-icon {
  font-size: 0.85rem;
}

.lib-lightbox-ref-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding: 0.35rem;
  background: #F0FDFA;
  border: 1px solid #CFFAFE;
  border-radius: 0.4rem;
}

.lib-lightbox-ref-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid #A5F3FC;
}

.lib-lightbox-ref-remove {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.lib-lightbox-ref-remove:hover {
  color: #EF4444;
}

.lib-lightbox-edit-actions {
  margin-bottom: 0.5rem;
}

.lib-lightbox-edit-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: #0F766E;
}

.lib-lightbox-edit-error {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 0.4rem;
}

.lib-lightbox-save-bar {
  border: 2px solid #67E8F9;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);
}

/* Lightbox responsive */
@media (max-width: 700px) {
  .lib-lightbox-body {
    flex-direction: column;
  }
  .lib-lightbox-image {
    max-height: 45vh;
  }
  .lib-lightbox-info {
    flex: 1;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .lib-folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .lib-image-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .lib-header {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ============================================================
   OVERVIEW / DASHBOARD HOME
   ============================================================ */

.overview-kpi {
  transition: transform 0.15s, box-shadow 0.15s;
}

.overview-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
  .overview-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   ROLE PERMISSIONS TOGGLE SWITCHES
   ============================================================ */

.perm-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.perm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #D1D5DB;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.perm-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.perm-toggle input:checked + .perm-slider {
  background-color: #22C55E;
}

.perm-toggle input:checked + .perm-slider::before {
  transform: translateX(16px);
}

.perm-toggle input:focus + .perm-slider {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* ============================================================
   WELCOME TOUR
   Data-driven guided tour for first-time users.
   To add/remove tour steps, edit TOUR_STEPS in dashboard.js.
   ============================================================ */

/* Overlay behind tour elements */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  transition: opacity 0.3s ease;
}

/* Welcome modal (step 0 — before tab tour starts) */
.tour-welcome {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: white;
  border-radius: 1rem;
  max-width: 520px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: tourFadeIn 0.35s ease;
}

@keyframes tourFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tour-welcome-header {
  background: var(--primary-gradient);
  padding: 2rem 2.5rem 1.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.tour-welcome-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.tour-welcome-header p {
  opacity: 0.9;
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.5;
}

.tour-welcome-header .tour-decor {
  position: absolute;
  right: -15px;
  top: -15px;
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.tour-welcome-body {
  padding: 1.5rem 2.5rem 2rem;
}

.tour-role-badge {
  display: inline-block;
  background: #F0F9FF;
  color: #0C4A6E;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.tour-capabilities {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.tour-capabilities li {
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tour-capabilities li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  flex-shrink: 0;
}

.tour-welcome-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tour-btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.tour-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.tour-btn-skip {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
}

.tour-btn-skip:hover {
  color: var(--text-color);
}

/* Tooltip (steps 1+) */
.tour-tooltip {
  position: fixed;
  z-index: 9999;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-width: 360px;
  width: 90vw;
  animation: tourFadeIn 0.25s ease;
}

.tour-tooltip-header {
  padding: 1.25rem 1.5rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tour-tooltip-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.tour-tooltip-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.tour-tooltip-body {
  padding: 0.25rem 1.5rem 1rem;
  font-size: 0.88rem;
  color: #4B5563;
  line-height: 1.55;
}

.tour-tooltip-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-progress {
  display: flex;
  gap: 5px;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5E7EB;
  transition: background 0.2s;
}

.tour-dot.active {
  background: var(--primary-color);
}

.tour-dot.done {
  background: var(--success-color);
}

.tour-tooltip-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tour-btn-next {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.tour-btn-next:hover {
  background: #0C4A6E;
}

.tour-btn-back {
  background: #F3F4F6;
  color: #374151;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.tour-btn-back:hover {
  background: #E5E7EB;
}

/* Highlighted element during tour */
.tour-highlight {
  position: relative;
  z-index: 9999 !important;
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.4), 0 0 20px rgba(14, 165, 233, 0.15);
  transition: box-shadow 0.3s ease;
}

/* ============================================================
   MOBILE-RESPONSIVE ENHANCEMENTS (8.4)
   ============================================================ */

/* Touch-friendly tap targets */
@media (max-width: 768px) {
  /* Ensure minimum 44px touch targets on buttons */
  .btn, .tab-btn, .qv2-btn, .qv2-platform-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Settings tab: stack brand config sections */
  .brand-config-body .form-group {
    width: 100% !important;
  }
  .brand-config-body > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Calendar: make scrollable horizontally */
  .calendar-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Variants panel: full width on mobile */
  .variants-panel {
    margin-top: 0.5rem;
  }
  .variant-card {
    padding: 0.75rem;
  }

  /* Evergreen cards: stack vertically */
  .evergreen-card {
    flex-direction: column !important;
  }

  /* Publishing queue: collapsible groups tighter spacing */
  .queue-group-header {
    padding: 0.6rem 0.75rem;
  }

  /* Modal: full screen on small devices */
  .modal-content {
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
    padding: 1rem;
  }
  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Rewrite instructions row: stack on mobile */
  .rewrite-instructions-row {
    flex-wrap: wrap;
  }
  .rewrite-instructions-input {
    width: 100%;
    flex: unset;
  }
  .btn-rewrite-inline {
    flex: 1;
  }

  /* Analytics: single column KPIs on narrow screens */
  .analytics-kpi-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Social preview: full-width */
  .social-preview-section {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  /* Ultra-compact for phones */
  .container {
    padding: 0.5rem;
  }

  .analytics-kpi-row {
    grid-template-columns: 1fr;
  }

  /* Stack export buttons */
  .ci-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start !important;
  }

  /* Tab text smaller */
  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Modal margins */
  .modal-content {
    padding: 0.75rem;
  }

  /* Quality badge inline */
  .qv2-meta {
    flex-wrap: wrap;
  }
}

/* ═══════════════════════════════════════════
   5.1 — AI Image Generation Panel (Library)
   ═══════════════════════════════════════════ */
.lib-ai-generate-btn {
  background: linear-gradient(135deg, #0D9488, #0C4A6E);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.lib-ai-generate-btn:hover { opacity: 0.9; }

.lib-ai-gen-panel {
  background: #FAFAFE;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.lib-ai-gen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.lib-ai-gen-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #1F2937;
}
.lib-ai-gen-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #9CA3AF;
  cursor: pointer;
}
.lib-ai-gen-close:hover { color: #374151; }

/* Spinner for AI generation loading states */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #D1D5DB;
  border-top-color: #0C4A6E;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   5.2 — Quick Generate Image (Queue Card)
   ═══════════════════════════════════════════ */
.qv2-gen-img-btn:hover {
  background: #0891B2 !important;
  color: #fff !important;
}

.qv2-image-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  background: #F9FAFB;
  border-radius: 6px;
  min-width: 100px;
}

/* ============================================================
   CLIENT ONBOARDING WIZARD
   ============================================================ */

.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.7);
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.onboarding-wizard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9999;
}

.onboarding-content {
  padding: 2rem;
}

.onboarding-header {
  margin-bottom: 1.5rem;
}

.onboarding-header h1 {
  font-size: 1.75rem;
  color: #111827;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.onboarding-header p {
  color: #6B7280;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.onboarding-progress-bar {
  height: 4px;
  background: #0D9488;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.onboarding-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.onboarding-step-dot {
  flex: 1;
  padding: 0.75rem;
  border-radius: 8px;
  background: #F3F4F6;
  border: 2px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #9CA3AF;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.onboarding-step-dot.active {
  background: #0D9488;
  color: white;
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.onboarding-step-dot.done {
  background: #D1FAE5;
  color: #059669;
  border-color: #6EE7B7;
}

.onboarding-step-content {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-step-content h2 {
  font-size: 1.5rem;
  color: #111827;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.onboarding-step-content > p {
  color: #6B7280;
  margin-bottom: 1.5rem;
}

.onboarding-step-content .form-group {
  margin-bottom: 1.25rem;
}

.onboarding-step-content label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.onboarding-step-content input,
.onboarding-step-content select,
.onboarding-step-content textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.onboarding-step-content input:focus,
.onboarding-step-content select:focus,
.onboarding-step-content textarea:focus {
  outline: none;
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.onboarding-step-content small {
  display: block;
  color: #9CA3AF;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.onboarding-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  justify-content: flex-end;
}

.onboarding-actions .btn {
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.onboarding-actions .btn-primary {
  background: #0D9488;
  color: white;
}

.onboarding-actions .btn-primary:hover:not(:disabled) {
  background: #0F766E;
  transform: translateY(-1px);
}

.onboarding-actions .btn-primary:disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
}

.onboarding-actions .btn-light {
  background: #F3F4F6;
  color: #374151;
  border: 1px solid #D1D5DB;
}

.onboarding-actions .btn-light:hover {
  background: #E5E7EB;
}

/* Content Pillars */
.pillars-container {
  background: #F9FAFB;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.pillar-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.pillar-row:last-child {
  margin-bottom: 0;
}

.pillar-name {
  flex: 1;
  padding: 0.65rem;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 0.9rem;
}

.pillar-percentage {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: white;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 0 0.5rem;
  width: 90px;
  flex-shrink: 0;
}

.pillar-percent {
  width: 50px;
  border: none;
  padding: 0.65rem 0.25rem;
  text-align: center;
  font-size: 0.9rem;
  -moz-appearance: textfield;  /* Firefox: hide spin buttons */
}

/* Hide number input spin buttons and prevent scroll-to-change */
.pillar-percent::-webkit-outer-spin-button,
.pillar-percent::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pillar-percent:focus {
  outline: none;
}

.pillar-percentage span {
  color: #9CA3AF;
  font-weight: 600;
}

.btn-remove-pillar {
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-remove-pillar:hover {
  background: #FECACA;
}

.pillar-total {
  padding: 0.75rem 1rem;
  background: #FEF3C7;
  border: 1px solid #FDE047;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  color: #92400E;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.pillar-total.valid {
  background: #F0FDF4;
  border-color: #DCFCE7;
  color: #15803D;
}

.pillar-total span {
  font-weight: 400;
  opacity: 0.8;
  margin-left: 0.5rem;
}

.btn-add-pillar {
  background: #F3F4F6;
  color: #374151;
  border: 1px dashed #9CA3AF;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-pillar:hover {
  background: #E5E7EB;
  border-color: #6B7280;
}

/* Meta Info Box */
.meta-info-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.meta-info-box strong {
  color: #1E40AF;
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.meta-info-box ul li {
  color: #1E40AF;
  opacity: 0.85;
}

/* Summary Box */
.wizard-summary {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.95rem;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item strong {
  color: #374151;
  font-weight: 600;
}

.summary-item span {
  color: #6B7280;
}

/* Generation Progress */
.generation-spinner {
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  animation: spin 0.6s linear infinite;
}

#generationComplete {
  animation: slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 640px) {
  .onboarding-wizard {
    width: 95%;
    max-height: 95vh;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .onboarding-content {
    padding: 1.5rem;
  }

  .onboarding-header h1 {
    font-size: 1.35rem;
  }

  .onboarding-actions {
    flex-wrap: wrap;
  }

  .onboarding-actions .btn {
    flex: 1 1 auto;
  }

  .pillar-row {
    gap: 0.5rem;
  }
}

/* ============================================================
   SECTION 4: BILLING & SUBSCRIPTION UI
   ============================================================ */

/* Trial banner in header */
.trial-banner {
  background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
  border-left: 4px solid #F59E0B;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #92400E;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

.trial-banner strong {
  font-weight: 600;
}

.trial-banner.expired {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border-left-color: #DC2626;
  color: #991B1B;
}

.trial-banner.critical {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border-left-color: #DC2626;
  color: #991B1B;
}

.trial-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Billing plan cards */
.billing-plan-card {
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  padding: 1.5rem;
  background: #F9FAFB;
  transition: all 0.2s ease;
}

.billing-plan-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.billing-plan-card.active {
  border-color: #10B981;
  background: #F0FDF4;
}

.billing-plan-card h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.billing-plan-price {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin: 0.75rem 0;
}

.billing-plan-price small {
  font-size: 0.9rem;
  font-weight: 400;
  color: #6B7280;
}

.billing-features {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.billing-features li {
  padding: 0.5rem 0;
  color: #4B5563;
  font-size: 0.9rem;
}

.billing-features li:before {
  content: '✓ ';
  color: #10B981;
  font-weight: 600;
  margin-right: 0.5rem;
}

/* Billing table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.billing-table thead {
  background: #F3F4F6;
  border-bottom: 2px solid #E5E7EB;
}

.billing-table th {
  padding: 0.75rem;
  text-align: left;
  color: #6B7280;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.billing-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #E5E7EB;
  color: #111827;
}

.billing-table tbody tr:hover {
  background: #F9FAFB;
}

.billing-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.billing-status.paid {
  background: #D1FAE5;
  color: #065F46;
}

.billing-status.open {
  background: #FEF3C7;
  color: #92400E;
}

.billing-status.past_due {
  background: #FECACA;
  color: #991B1B;
}

/* Payment method display */
.payment-method-card {
  padding: 1rem;
  background: #F0FDF4;
  border: 1px solid #DCFCE7;
  border-radius: 6px;
  margin-top: 1rem;
}

.payment-method-card strong {
  color: #16A34A;
}

/* Dunning banner (payment failed) */
.dunning-banner {
  background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
  border-left: 4px solid #F59E0B;
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.dunning-banner strong {
  color: #92400E;
  display: block;
  margin-bottom: 0.5rem;
}

.dunning-banner p {
  color: #78350F;
  font-size: 0.95rem;
  margin: 0;
}

/* Grace period indicator */
.grace-period-warning {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border-left: 4px solid #DC2626;
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.grace-period-warning strong {
  color: #991B1B;
  display: block;
  margin-bottom: 0.5rem;
}

/* ============================================================ */
/* ============ PAGE HEALTH ============ */

.analytics-view-toggle {
  display: flex;
  background: var(--bg-light, #F3F4F6);
  border-radius: 0.5rem;
  padding: 3px;
  gap: 2px;
}

.analytics-view-toggle .toggle-btn {
  padding: 0.4rem 1rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.analytics-view-toggle .toggle-btn.active {
  background: var(--bg-white, #FFFFFF);
  color: var(--text-color, #111827);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.analytics-view-toggle .toggle-btn:hover:not(.active) {
  color: var(--text-color, #111827);
}

/* Health score ring */
.health-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.health-score-ring svg {
  transform: rotate(-90deg);
}

.health-score-ring .score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-score-ring .score-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.health-score-ring .score-label {
  display: block;
  font-size: 0.7rem;
  color: #6B7280;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Overall health card */
.health-overview-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.health-overview-info {
  flex: 1;
}

.health-overview-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.health-overview-info .health-band-label {
  font-weight: 600;
  font-size: 1rem;
}

.health-overview-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #6B7280;
}

.health-overview-stats span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Action items */
.health-actions-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.health-actions-card h3 {
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--text-color);
}

.health-action-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.health-action-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.action-severity {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
}

.action-severity.critical { background: #EF4444; }
.action-severity.warning  { background: #F59E0B; }
.action-severity.info     { background: #3B82F6; }

.action-content {
  flex: 1;
}

.action-message {
  font-weight: 500;
  color: var(--text-color);
  display: block;
}

.action-detail {
  color: #6B7280;
  font-size: 0.82rem;
  margin-top: 2px;
  display: block;
}

.action-platform-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.action-platform-tag.facebook { background: #EFF6FF; color: #1D4ED8; }
.action-platform-tag.instagram { background: #FDF2F8; color: #BE185D; }

/* Facility breakdown table */
.health-facility-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.health-facility-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.health-facility-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.health-facility-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.health-facility-table tbody tr:hover {
  background: var(--bg-light, #F9FAFB);
}

.health-facility-table .platform-icons {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #FFF;
}

.platform-icon.fb { background: #1877F2; }
.platform-icon.ig { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.platform-icon.none { background: #D1D5DB; color: #9CA3AF; }

/* Health score badge (inline) */
.health-score-badge {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 9999px;
}

.health-band-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

/* Expanded facility detail card */
.health-detail-card {
  background: var(--bg-light, #F9FAFB);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin: 0.5rem 0 1rem;
  animation: healthDetailSlide 0.2s ease-out;
}

@keyframes healthDetailSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.health-category-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
  margin-bottom: 1rem;
}

.health-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.health-bar-label {
  font-size: 0.82rem;
  color: #6B7280;
  min-width: 120px;
}

.health-bar-track {
  flex: 1;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.health-bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 45px;
  text-align: right;
}

.health-checks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.health-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: #F3F4F6;
  color: #374151;
}

.health-check-chip.passed { background: #ECFDF5; color: #065F46; }
.health-check-chip.failed { background: #FEF2F2; color: #991B1B; }

/* Reviews section */
.health-review-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.health-review-card:last-child {
  border-bottom: none;
}

.review-stars {
  color: #F59E0B;
  white-space: nowrap;
  flex-shrink: 0;
}

.review-body {
  flex: 1;
}

.review-text {
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.review-meta {
  font-size: 0.78rem;
  color: #9CA3AF;
}

.review-link {
  color: #3B82F6;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
}

.review-link:hover {
  text-decoration: underline;
}

/* Health loading state */
.health-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #6B7280;
}

.health-loading .analytics-spinner {
  margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .health-overview-card {
    flex-direction: column;
    text-align: center;
  }
  .health-overview-stats {
    justify-content: center;
  }
  .health-category-bars {
    grid-template-columns: 1fr;
  }
}

/* ============ ENGAGEMENT HUB ============ */

.engagement-stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.engagement-stat {
  flex: 1;
  min-width: 100px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.engagement-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.engagement-stat-label {
  display: block;
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 2px;
}

.engagement-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1rem;
}

.engagement-tab {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.engagement-tab.active {
  color: var(--primary-color, #0EA5E9);
  border-bottom-color: var(--primary-color, #0EA5E9);
}

.engagement-tab:hover:not(.active) {
  color: var(--text-color);
}

/* Engagement cards */
.engagement-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}

.engagement-card.needs-reply {
  border-left: 3px solid #EF4444;
}

.engagement-card.replied {
  border-left: 3px solid #10B981;
  opacity: 0.75;
}

.engagement-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.engagement-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.engagement-facility-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #EFF6FF;
  color: #1D4ED8;
  padding: 1px 6px;
  border-radius: 3px;
}

.engagement-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.engagement-status.needs-reply {
  background: #FEF2F2;
  color: #DC2626;
}

.engagement-status.replied {
  background: #ECFDF5;
  color: #065F46;
}

.engagement-card-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.5;
}

.engagement-post-context {
  font-size: 0.78rem;
  color: #9CA3AF;
  margin-top: 0.35rem;
  font-style: italic;
}

.engagement-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Reply zone */
.engagement-reply-zone {
  margin-top: 0.5rem;
}

.engagement-reply-options {
  background: var(--bg-light, #F9FAFB);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.engagement-reply-option {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: var(--bg-white);
  transition: all 0.15s;
}

.engagement-reply-option:hover {
  border-color: var(--primary-color, #0EA5E9);
}

.engagement-reply-option.selected {
  border-color: var(--primary-color, #0EA5E9);
  box-shadow: 0 0 0 1px var(--primary-color, #0EA5E9);
}

.reply-option-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.reply-tone-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #F3F4F6;
  color: #374151;
  padding: 1px 6px;
  border-radius: 3px;
}

.reply-option-text {
  font-size: 0.85rem;
  color: var(--text-color);
  line-height: 1.4;
}

.engagement-reply-textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 60px;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.engagement-reply-textarea:focus {
  outline: none;
  border-color: var(--primary-color, #0EA5E9);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.engagement-reply-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .engagement-stats-bar {
    flex-wrap: wrap;
  }
  .engagement-stat {
    min-width: 80px;
  }
  .engagement-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   REPORTS — Analytics sub-tab
   ============================================================ */

.reports-container {
  max-width: 900px;
  margin: 0 auto;
}

.reports-header {
  margin-bottom: 1.5rem;
}
.reports-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 0.35rem;
}
.reports-header p {
  font-size: 0.85rem;
  color: var(--text-secondary, #6B7280);
  margin: 0;
}

/* Config section */
.reports-config {
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.reports-config-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.reports-config-field {
  flex: 1;
  min-width: 180px;
}
.reports-config-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #6B7280);
  margin-bottom: 0.4rem;
}
.reports-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.reports-checkbox {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-primary, #374151);
  cursor: pointer;
  font-weight: 400 !important;
}
.reports-checkbox input[type="checkbox"] {
  accent-color: var(--primary, #0C4A6E);
  width: 15px;
  height: 15px;
}

/* Action buttons */
.reports-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.reports-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reports-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.reports-btn-icon {
  font-size: 1rem;
}
.reports-email-btn {
  background: #10B981;
  border: 1px solid #10B981;
  color: #fff;
}
.reports-email-btn:hover:not(:disabled) {
  background: #059669;
}
.reports-preview-btn {
  background: #fff;
  border: 1px solid var(--border, #D1D5DB);
  color: var(--text-primary, #374151);
}
.reports-preview-btn:hover:not(:disabled) {
  background: var(--bg-light, #F9FAFB);
}

/* Notices */
.reports-notice {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.83rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.reports-notice strong {
  font-weight: 600;
}
.reports-notice-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}
.reports-notice-info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}
.reports-notice-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

/* Progress indicator */
.reports-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-light, #F9FAFB);
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #6B7280);
}
.reports-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #E5E7EB;
  border-top-color: var(--primary, #0C4A6E);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Report history */
.reports-history {
  margin-top: 1.5rem;
}
.reports-history h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 0.75rem;
}
.reports-history-list {
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 0.5rem;
  overflow: hidden;
}
.reports-history-empty {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted, #9CA3AF);
  margin: 0;
}
.reports-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #F3F4F6);
  font-size: 0.83rem;
}
.reports-history-item:last-child {
  border-bottom: none;
}
.reports-history-icon {
  font-size: 1.1rem;
  width: 28px;
  text-align: center;
}
.reports-history-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.reports-history-detail strong {
  color: var(--text-primary, #111827);
  font-size: 0.83rem;
}
.reports-history-action {
  color: var(--text-muted, #9CA3AF);
  font-size: 0.78rem;
}
.reports-history-time {
  color: var(--text-muted, #9CA3AF);
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .reports-config-row {
    flex-direction: column;
    gap: 1rem;
  }
  .reports-actions {
    flex-direction: column;
  }
  .reports-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   UNIFIED INBOX — Top-level tab
   ============================================================ */

.inbox-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* Toolbar */
.inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.inbox-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.inbox-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inbox-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
  white-space: nowrap;
}

/* Type filter tabs */
.inbox-type-tabs {
  display: flex;
  background: var(--bg-light, #F3F4F6);
  border-radius: 0.5rem;
  padding: 3px;
  gap: 2px;
}
.inbox-type-tab {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #6B7280);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.inbox-type-tab.active {
  background: #fff;
  color: var(--primary, #0C4A6E);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.inbox-type-tab:hover:not(.active) {
  color: var(--text-primary, #374151);
}

/* Loading */
.inbox-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary, #6B7280);
  font-size: 0.9rem;
}
.inbox-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--primary, #0C4A6E);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 0.75rem;
}

/* Not connected state */
.inbox-not-connected {
  text-align: center;
  padding: 3rem 1rem;
}
.inbox-not-connected-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.inbox-not-connected h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-primary, #111827);
}
.inbox-not-connected p {
  font-size: 0.9rem;
  color: var(--text-secondary, #6B7280);
  margin: 0;
}

/* Stats bar */
.inbox-stats-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.inbox-stat {
  flex: 1;
  min-width: 100px;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}
.inbox-stat-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary, #0C4A6E);
}
.inbox-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted, #9CA3AF);
  margin-top: 0.15rem;
}

/* Permission notice */
.inbox-permission-notice {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.inbox-permission-notice code {
  background: rgba(0,0,0,0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.78rem;
}

/* Item list */
.inbox-list {
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg-white, #fff);
}
.inbox-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted, #9CA3AF);
  font-size: 0.9rem;
}

/* Individual item */
.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border, #F3F4F6);
  cursor: pointer;
  transition: background 0.1s ease;
}
.inbox-item:last-of-type {
  border-bottom: none;
}
.inbox-item:hover {
  background: var(--bg-light, #F9FAFB);
}
.inbox-item-needs-reply {
  border-left: 3px solid #EF4444;
}
.inbox-item-unread {
  border-left: 3px solid #3B82F6;
  background: #EFF6FF;
}
.inbox-item-replied {
  border-left: 3px solid #10B981;
}

.inbox-item-left {
  flex-shrink: 0;
  padding-top: 2px;
}
.inbox-item-type-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  display: block;
}

.inbox-item-body {
  flex: 1;
  min-width: 0;
}
.inbox-item-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.inbox-item-author {
  font-size: 0.85rem;
  color: var(--text-primary, #111827);
}
.inbox-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #9CA3AF);
  margin-left: auto;
}
.inbox-item-preview {
  font-size: 0.83rem;
  color: var(--text-secondary, #4B5563);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item-context {
  font-size: 0.75rem;
  color: var(--text-muted, #9CA3AF);
  margin-top: 0.2rem;
  font-style: italic;
}

/* Badges */
.inbox-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.inbox-badge-needs-reply {
  background: #FEF2F2;
  color: #DC2626;
}
.inbox-badge-replied {
  background: #ECFDF5;
  color: #059669;
}
.inbox-badge-unread {
  background: #DBEAFE;
  color: #2563EB;
}

.inbox-rating {
  color: #F59E0B;
  font-size: 0.75rem;
  letter-spacing: -1px;
}
.inbox-rating-lg {
  color: #F59E0B;
  font-size: 1rem;
  letter-spacing: -1px;
}

/* Inbox tab badge */
.inbox-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #EF4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 10px;
  padding: 0 4px;
  margin-left: 5px;
  position: relative;
  top: -1px;
  line-height: 1;
}

/* Mark as read button */
.inbox-mark-read-btn {
  background: none;
  border: 1px solid #D1D5DB;
  font-size: 0.75rem;
  color: #6B7280;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}
.inbox-mark-read-btn:hover {
  background: #10B981;
  color: #fff;
  border-color: #10B981;
}

/* Expand button */
.inbox-item-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.inbox-expand-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--text-muted, #9CA3AF);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
}
.inbox-expand-btn:hover {
  background: var(--bg-light, #F3F4F6);
  color: var(--text-primary, #374151);
}

/* Detail panel (expanded) */
.inbox-item-detail {
  background: var(--bg-light, #F9FAFB);
  border-bottom: 1px solid var(--border, #E5E7EB);
}
.inbox-detail-inner {
  padding: 1rem 1.25rem;
}
.inbox-detail-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted, #9CA3AF);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.inbox-detail-type {
  font-weight: 600;
  color: var(--primary, #0C4A6E);
}
.inbox-detail-rating {
  margin-bottom: 0.5rem;
}
.inbox-detail-text {
  background: #fff;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 0.5rem;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.inbox-detail-text strong {
  color: var(--text-primary, #111827);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}
.inbox-detail-text p {
  margin: 0;
  color: var(--text-secondary, #374151);
}
.inbox-detail-context {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 0.375rem;
  padding: 0.6rem;
  font-size: 0.8rem;
  color: #92400E;
  margin-bottom: 0.75rem;
}
.inbox-detail-context small {
  font-weight: 600;
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.inbox-detail-existing-reply {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 0.375rem;
  padding: 0.7rem;
  font-size: 0.83rem;
  margin-bottom: 0.75rem;
}
.inbox-detail-existing-reply strong {
  color: #065F46;
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.inbox-detail-existing-reply p {
  margin: 0;
  color: #047857;
}

/* Reply section */
.inbox-reply-section {
  border-top: 1px solid var(--border, #E5E7EB);
  padding-top: 0.75rem;
}
.inbox-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.inbox-reply-header strong {
  font-size: 0.85rem;
  color: var(--text-primary, #111827);
}
.inbox-reply-ai-btns {
  display: flex;
  gap: 0.35rem;
}
.inbox-ai-btn {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #D1D5DB);
  color: var(--text-secondary, #6B7280);
  border-radius: 0.375rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.inbox-ai-btn:hover {
  background: var(--primary, #0C4A6E);
  color: #fff;
  border-color: var(--primary, #0C4A6E);
}
.inbox-ai-empathetic {
  border-color: #FCA5A5;
  color: #DC2626;
}
.inbox-ai-empathetic:hover {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}
.inbox-reply-text {
  width: 100%;
  border: 1px solid var(--border, #D1D5DB);
  border-radius: 0.5rem;
  padding: 0.65rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  line-height: 1.4;
}
.inbox-reply-text:focus {
  outline: none;
  border-color: var(--primary, #0C4A6E);
  box-shadow: 0 0 0 2px rgba(12, 74, 110, 0.1);
}
.inbox-reply-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.inbox-send-btn {
  padding: 0.45rem 1.25rem;
  font-size: 0.82rem;
}
.inbox-reply-status {
  font-size: 0.78rem;
  color: var(--text-muted, #9CA3AF);
}

/* More notice */
.inbox-more-notice {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted, #9CA3AF);
}

/* Error */
.inbox-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
}
.inbox-error strong {
  color: #991B1B;
  display: block;
  margin-bottom: 0.35rem;
}
.inbox-error p {
  color: #B91C1C;
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 640px) {
  .inbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .inbox-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }
  .inbox-stats-bar {
    gap: 0.35rem;
  }
  .inbox-stat {
    min-width: 70px;
    padding: 0.5rem;
  }
  .inbox-item-meta {
    display: none;
  }
  .inbox-reply-ai-btns {
    flex-wrap: wrap;
  }
}

/* ============================================================
   EVERGREEN RECYCLING
   ============================================================ */
.recycle-section {
  border: 1px solid #C7D2FE;
  border-radius: 0.75rem;
  margin-top: 1.5rem;
  overflow: hidden;
  background: #FAFBFF;
}
.recycle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #EEF2FF;
  border-bottom: 1px solid #C7D2FE;
}
.recycle-header h3 {
  font-size: 1rem;
  color: #3730A3;
}
.recycle-body {
  padding: 1rem 1.25rem;
}
.recycle-hint {
  font-size: 0.8rem;
  color: #6B7280;
  margin: 0 0 1rem;
  line-height: 1.4;
}
.recycle-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.recycle-candidate {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.recycle-candidate:hover {
  border-color: #A5B4FC;
  box-shadow: 0 1px 4px rgba(99,102,241,0.1);
}
.recycle-candidate-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.recycle-candidate-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.recycle-facility {
  font-weight: 600;
  font-size: 0.85rem;
  color: #1F2937;
}
.recycle-pillar {
  font-size: 0.75rem;
  background: #F3F4F6;
  color: #6B7280;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.recycle-badge-always {
  font-size: 0.7rem;
  background: #DCFCE7;
  color: #166534;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.recycle-candidate-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #EEF2FF;
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  min-width: 48px;
}
.recycle-score-label {
  font-size: 0.65rem;
  color: #6366F1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.recycle-score-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3730A3;
}
.recycle-candidate-caption {
  font-size: 0.82rem;
  color: #4B5563;
  line-height: 1.45;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: #F9FAFB;
  border-radius: 0.375rem;
  border: 1px solid #F3F4F6;
}
.recycle-candidate-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.recycle-candidate-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.recycle-candidate-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .recycle-candidate-top {
    flex-direction: column;
    gap: 0.5rem;
  }
  .recycle-candidate-meta {
    gap: 0.5rem;
  }
  .recycle-candidate-actions {
    flex-direction: column;
  }
  .recycle-candidate-actions .btn {
    width: 100%;
    text-align: center;
  }
}
