:root {
  --bg-main: #0a0e17;
  --bg-surface: #121826;
  --bg-card: #182234;
  --bg-card-hover: #1e2c44;
  --border-color: #25334d;
  --border-light: #324364;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.25);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --fb-blue: #1877f2;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #25334d rgba(18, 24, 38, 0.4);
}

/* Custom Sleek Dark Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(18, 24, 38, 0.4);
}
::-webkit-scrollbar-thumb {
  background: #25334d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* App Container */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  gap: 14px;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.header-user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.user-badge-btn:hover {
  background: rgba(30, 58, 138, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.user-avatar-tiny {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.header-user-name-text {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.88rem;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user-role-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.header-user-role-badge.badge-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.header-user-role-badge.badge-client {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.header-user-role-badge.badge-impersonating {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.user-badge-btn .user-caret {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.user-badge-btn:hover .user-caret {
  color: #93c5fd;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.45), 0 0 14px rgba(59, 130, 246, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: block;
}

.brand-text h1 {
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.header-stats-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-stats-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--text-main);
}

.status-connected {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.status-connected strong {
  color: var(--success);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Overview Stats Bar (Positioned under header) */
.overview-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.overview-stats-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.overview-stats-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.overview-stats-bar .stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.overview-stats-bar .stat-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.overview-stats-bar .stat-pill strong {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.overview-stats-bar .btn-meta-shortcut {
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  box-sizing: border-box;
}

.overview-stats-bar .btn-meta-shortcut:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.overview-stats-bar .btn-meta-shortcut:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar & Cards */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.schedule-card {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, var(--bg-surface) 100%);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 1.05rem;
  color: #fff;
}

.badge-draft {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  transition: all 0.3s ease;
}

.badge-live {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.disabled-form-group {
  opacity: 0.35 !important;
  pointer-events: none !important;
  user-select: none !important;
  cursor: not-allowed !important;
  filter: grayscale(0.85);
  transition: all 0.3s ease;
}

.disabled-form-group input,
.disabled-form-group select {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #64748b !important;
  cursor: not-allowed !important;
}

.disabled-hint {
  font-size: 0.72rem;
  color: #f59e0b;
  font-weight: 600;
  margin-left: 6px;
  animation: fadeIn 0.2s ease;
}

.schedule-explainer {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  background: #10192b !important;
  border: 1px solid #22324f !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#setting-email,
#new-user-email {
  background: #10192b !important;
  color: #f8fafc !important;
  border: 1px solid #22324f !important;
  border-radius: 8px !important;
}

/* Chrome / Safari / Edge Autofill Override to prevent white background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #10192b inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
  border-radius: 8px !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="datetime-local"]:focus,
#setting-email:focus,
#new-user-email:focus,
textarea:focus,
select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  background: #142038 !important;
}

.search-input-wrap {
  position: relative;
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Custom Checkbox (Strictly One Line) */
.form-group label.custom-checkbox,
.custom-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  user-select: none !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
}

.custom-checkbox input {
  display: none !important;
}

.checkmark {
  width: 18px !important;
  height: 18px !important;
  background: #10192b !important;
  border: 1.5px solid #2a3d60 !important;
  border-radius: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.custom-checkbox:hover .checkmark {
  border-color: #3b82f6 !important;
}

.custom-checkbox input:checked + .checkmark {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5) !important;
}

.custom-checkbox input:checked + .checkmark::after {
  content: '✓' !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.checkbox-text {
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  color: var(--text-main) !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* -------------------------------------------------------------
   Channel Toggles with Circular Blue/White Indicator (All in One Line)
   ------------------------------------------------------------- */
.channel-toggles {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  margin-top: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.form-group label.channel-card,
.channel-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 14px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none !important;
  position: relative !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  width: 100% !important;
  overflow: hidden !important;
}

.channel-card:hover {
  border-color: var(--primary) !important;
  background: var(--bg-card-hover) !important;
}

/* Hide default HTML checkbox */
.channel-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

/* Circular Indicator: Empty outline when unchecked (NO dot!), Blue with checkmark when checked */
.channel-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #64748b;
  background: transparent;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  box-sizing: border-box;
}

/* When unchecked: absolutely empty inside, NO dot! */
.channel-circle::after {
  content: '' !important;
  display: none !important;
}

.channel-card:hover .channel-circle {
  border-color: #94a3b8;
}

/* When CHECKED: Background turns bright blue, border turns blue */
.channel-card input[type="checkbox"]:checked ~ .channel-circle,
.channel-card.is-checked .channel-circle {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6) !important;
}

/* Inside of circle when CHECKED: Bold white checkmark */
.channel-card input[type="checkbox"]:checked ~ .channel-circle::after,
.channel-card.is-checked .channel-circle::after {
  content: '✓' !important;
  display: flex !important;
  background: transparent !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
}

/* Active card highlight when checked */
.channel-card:has(input[type="checkbox"]:checked),
.channel-card.is-checked {
  border-color: rgba(59, 130, 246, 0.5) !important;
  background: rgba(59, 130, 246, 0.08) !important;
}

.channel-info {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

.ch-brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ch-brand-icon.fb {
  background: #1877f2;
  color: #ffffff;
}

.ch-brand-icon.ig {
  background: linear-gradient(135deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  font-size: 0.8rem;
}

.ch-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.selected-summary {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 14px;
  color: #e2e8f0;
}

.selected-summary strong {
  color: var(--success);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
  transform: translateY(-1px);
}

.btn-success:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-warning-live {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

.btn-warning-live:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
}

.btn-warning-live:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  background: var(--bg-card);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.history-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.history-header-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.history-header-info span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Content Area */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-tab.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Tab Switching Visibility */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.catalog-actions {
  display: flex;
  gap: 8px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* Catalog Pagination */
.catalog-pagination {
  margin-top: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-info strong {
  color: #f8fafc;
  font-weight: 700;
}

.pagination-page-label {
  color: #94a3b8;
  font-size: 0.82rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pag-btn {
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.7);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  outline: none;
  white-space: nowrap;
}

.pag-btn:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.pag-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.05);
  color: #64748b;
  transform: none;
  box-shadow: none;
}

.pag-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pag-num-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.pag-num-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
  border-color: #3b82f6;
}

.pag-num-btn.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  font-weight: 700;
}

.pag-ellipsis {
  color: #64748b;
  padding: 0 4px;
  font-weight: 700;
  user-select: none;
}

.pagination-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.pag-size-label {
  font-weight: 500;
  color: #94a3b8;
}

.pag-size-select {
  background: #090e17;
  border: 1px solid #1e293b;
  border-radius: 8px;
  color: #f8fafc;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pag-size-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

@media (max-width: 900px) {
  .catalog-pagination {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .pagination-info, .pagination-controls, .pagination-settings {
    justify-content: center;
  }
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.product-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.product-card.is-published {
  opacity: 0.85;
  border-color: rgba(16, 185, 129, 0.4);
}

.card-select-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
}

.card-select-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.card-select-label input.product-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.card-select-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  cursor: pointer;
  box-sizing: border-box;
}

.card-select-label:hover .card-select-circle {
  transform: scale(1.15);
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
}

/* Checked state - solid vibrant blue with white checkmark */
.product-card.selected .card-select-circle,
.product-checkbox:checked + .card-select-circle,
.card-select-circle.is-checked {
  background: #2563eb !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.85), 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  transform: scale(1.05);
}

.product-card.selected .card-select-circle::after,
.product-checkbox:checked + .card-select-circle::after,
.card-select-circle.is-checked::after {
  content: '✓';
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

.card-image-wrap {
  width: 100%;
  height: 190px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer; /* Clicking image selects/deselects product */
  user-select: none;
}

.card-image-wrap img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s;
  pointer-events: none;
}

.card-image-wrap .badge-discount,
.card-image-wrap .badge-stock,
.card-image-wrap .badge-status {
  pointer-events: none;
}

.product-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

.badge-discount {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.badge-status {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

.badge-stock {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  z-index: 5;
}

.badge-in-stock {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-out-stock {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.card-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
}

.card-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 0.92rem;
  color: #fff;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.card-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  margin-bottom: 8px;
}

.card-price-regular {
  font-size: 1.05rem;
  font-weight: 700;
  color: #10b981;
}

.card-price-old {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 1.5px;
}

.card-price-sale {
  font-size: 1.12rem;
  font-weight: 800;
  color: #10b981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.card-price-pct {
  font-size: 0.74rem;
  font-weight: 800;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.3;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.card-actions .btn {
  flex: 1;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-thumb {
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 8px;
  object-fit: contain;
  padding: 4px;
}

.history-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.history-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-icon-small {
  width: 28px;
  height: 28px;
  background: var(--fb-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.fb-mock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.fb-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.fb-author-avatar {
  width: 40px;
  height: 40px;
  background: #1e3a8a;
  color: #60a5fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.fb-author-info h4 {
  font-size: 0.92rem;
  color: #fff;
}

.fb-post-time {
  font-size: 0.75rem;
  color: var(--text-dark);
}

.fb-post-content {
  font-size: 0.92rem;
  color: #f1f5f9;
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px dashed rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.35);
  transition: all 0.2s ease;
  outline: none;
  cursor: text;
}

.fb-post-content:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.55);
}

.fb-post-content:focus {
  border-color: #3b82f6;
  border-style: solid;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.fb-post-image-container {
  width: 100%;
  max-height: 320px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-post-image-container img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-message {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  animation: slideUp 0.3s ease;
}

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

.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Delete Options Modal Cards */
.delete-choice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.delete-choice-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.delete-choice-card .choice-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 12px;
  flex-shrink: 0;
}

.delete-choice-card .choice-content h4 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
  font-weight: 600;
}

.delete-choice-card .choice-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.delete-choice-card .choice-arrow {
  color: var(--text-dark);
  font-size: 1.3rem;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.delete-choice-card:hover .choice-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* Danger Choice */
.delete-choice-card.danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.delete-choice-card.danger:hover {
  border-color: var(--danger);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
}

.delete-choice-card.danger .choice-icon {
  background: rgba(239, 68, 68, 0.12);
}

.delete-choice-card.danger:hover .choice-arrow {
  color: var(--danger);
}

/* -------------------------------------------------------------
   MarijaSocialAutoPoster Additional Modals & Controls
   ------------------------------------------------------------- */
.stat-pill.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-pill.clickable:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
}



/* Meta Connect Modal Styles */
.meta-status-card {
  background: rgba(24, 119, 242, 0.08);
  border: 1px solid rgba(24, 119, 242, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.meta-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.meta-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.meta-badge-status.disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.meta-status-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.meta-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0 16px 0;
  color: var(--text-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.meta-divider::before,
.meta-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.meta-divider span {
  padding: 0 12px;
}

/* User Account Modal */
.current-user-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  flex: 1;
}

.user-info h4 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.user-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-badge-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.user-badge-client {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.user-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.user-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.user-account-item.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.user-account-item:hover {
  border-color: var(--primary);
}

.user-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-item-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.user-item-email {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.add-user-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

/* =============================================================
   Shared Header Language Selector (Client & Admin Dashboards)
   ============================================================= */
.lang-selector-nav {
  position: relative;
  display: inline-block;
}

.lang-btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 25, 43, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 5px 12px;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  height: 34px;
}

.lang-btn-nav:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-1px);
}

.lang-flag-img {
  width: 19px;
  height: 13px;
  border-radius: 2.5px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lang-arrow {
  font-size: 0.68rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.lang-btn-nav.open .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown-nav {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 5px;
  min-width: 155px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(59, 130, 246, 0.2);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: langFadeIn 0.18s ease;
}

.lang-dropdown-nav.show {
  display: flex;
}

.lang-item-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.lang-item-nav:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
}

.lang-item-nav.active {
  color: #60a5fa;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
}

.lang-item-nav .lang-check {
  margin-left: auto;
  font-size: 0.8rem;
  color: #60a5fa;
}

@keyframes langFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
