/* ==========================================================================
   OMNICOMMERCE AI STUDIO - MODERN DESIGN SYSTEM (VANILLA CSS)
   ========================================================================== */

:root {
  --bg-dark: #1A1A1A;
  --bg-card: rgba(36, 37, 38, 0.75);
  --bg-card-hover: rgba(46, 48, 51, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #B59410;

  /* Accent Colors */
  --primary: #B59410;
  --primary-hover: #9A7B1C;
  --primary-glow: rgba(181, 148, 16, 0.35);
  --secondary: #9A7B1C;
  --accent-pink: #ec4899;
  --accent-cyan: #70777A;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Typography Colors */
  --text-main: #F5F3EE;
  --text-muted: #A3A8AB;
  --text-dim: #70777A;

  /* Typography */
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(181, 148, 16, 0.15);
  --shadow-glow: 0 0 25px rgba(181, 148, 16, 0.4);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(181, 148, 16, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(154, 123, 28, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(112, 119, 122, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #1A1A1A;
}
::-webkit-scrollbar-thumb {
  background: #4A4D50;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(26, 26, 26, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
  font-size: 1.4rem;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #EADBA6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(36, 37, 38, 0.6);
  padding: 0.3rem 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 2px 10px var(--primary-glow);
  font-weight: 600;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
}

.status-dot.disconnected {
  background: var(--danger);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 1.75rem 2rem 3rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* Grid Layouts */
.dashboard-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

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

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

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(181, 148, 16, 0.15);
  color: #E2C76B;
  border: 1px solid rgba(181, 148, 16, 0.3);
  font-weight: 600;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(22, 22, 22, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(30, 30, 30, 0.9);
}

.form-textarea {
  min-height: 85px;
  resize: vertical;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px var(--shadow-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.775rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  border-radius: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Preset Pills (Gildan, Comfort Colors, etc.) */
.preset-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-pill:hover {
  background: rgba(181, 148, 16, 0.15);
  color: #EADBA6;
  border-color: rgba(181, 148, 16, 0.4);
}

.preset-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Product Folders List */
.folders-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.3rem;
  margin-top: 0.75rem;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.folder-item:hover {
  background: rgba(24, 32, 50, 0.8);
  border-color: rgba(181, 148, 16, 0.3);
  transform: translateX(3px);
}

.folder-item.active {
  background: rgba(181, 148, 16, 0.12);
  border-color: var(--primary);
}

.folder-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.folder-icon {
  font-size: 1.25rem;
}

.folder-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.folder-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.badge-9images {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.badge-missing {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 9-Image Gallery Grid */
.gallery-section {
  margin-bottom: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}

@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.image-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #1A1A1A;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: grab;
  user-select: none;
}

.image-card:not([draggable="true"]) {
  cursor: default;
}

.image-card:not([draggable="true"]):hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.image-card:active {
  cursor: grabbing;
}

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

.image-card.dragging {
  opacity: 0.35;
  transform: scale(0.92);
  border: 2px dashed #D4B23A !important;
  cursor: grabbing;
}

.image-card.drag-over {
  border: 2px solid #C5CACD !important;
  transform: scale(1.08) !important;
  box-shadow: 0 0 18px rgba(112, 119, 122, 0.6) !important;
  z-index: 10;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* Prevents image ghosting from interfering with card drag */
}

.image-card .img-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  z-index: 2;
  transition: all 0.2s ease;
  pointer-events: none;
}

.image-card.thumbnail-card {
  border-color: #B59410;
  box-shadow: 0 0 12px rgba(181, 148, 16, 0.45);
}

.image-card.thumbnail-card .img-badge {
  background: linear-gradient(135deg, #B59410, #9A7B1C);
  color: #fff;
  box-shadow: 0 2px 6px rgba(181, 148, 16, 0.4);
}

/* Quick hover actions for reordering/preview */
.image-card-actions {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 30, 0.72);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 4;
}

.image-card:hover .image-card-actions {
  opacity: 1;
}

.image-card.dragging .image-card-actions {
  display: none;
}

.image-card-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.image-card-btn:hover {
  background: #B59410;
  border-color: #B59410;
  color: #fff;
  transform: scale(1.05);
}

.image-card-btn.btn-make-thumb {
  background: rgba(181, 148, 16, 0.85);
  border-color: #D4B23A;
}

.image-card-btn.btn-make-thumb:hover {
  background: #9A7B1C;
  box-shadow: 0 0 8px rgba(181, 148, 16, 0.6);
}

/* Tabs inside Card */
.subtabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.subtab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.subtab-btn.active {
  color: #fff;
  background: rgba(181, 148, 16, 0.2);
  border: 1px solid rgba(181, 148, 16, 0.4);
}

/* HTML Description Preview */
.html-preview-box {
  background: #ffffff;
  color: #2E3033;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.html-preview-box h3 {
  color: #202122;
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}
.html-preview-box h3:first-child {
  margin-top: 0;
}
.html-preview-box ul {
  padding-left: 1.25rem;
  margin-bottom: 0.8rem;
}
.html-preview-box li {
  margin-bottom: 0.25rem;
}
.html-preview-box p {
  margin-bottom: 0.7rem;
}

/* Terminal Logs Box */
.terminal-box {
  background: #161616;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #E2C76B;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-entry {
  display: flex;
  gap: 0.6rem;
  line-height: 1.4;
}

.log-time {
  color: var(--text-dim);
}

.log-success { color: #34d399; }
.log-info { color: #D4B23A; }
.log-warn { color: #fbbf24; }
.log-error { color: #f87171; }

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
  display: none;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent-pink));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* History List Table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.history-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #242526;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  max-width: 650px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
}

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

/* Shimmer Loading Animation */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PINTEREST 3-PIN CARDS & AUTOMATION STYLES
   ========================================================================== */
.pin-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 992px) {
  .pin-grid-3 {
    grid-template-columns: 1fr;
  }
}

.pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.pin-card:hover {
  transform: translateY(-4px);
  border-color: rgba(230, 0, 35, 0.4);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(230, 0, 35, 0.15);
}

.pin-card-header {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pin-badge-num {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(230, 0, 35, 0.15);
  color: #ff4760;
  border: 1px solid rgba(230, 0, 35, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pin-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #1E1E1E;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pin-card:hover .pin-image-wrapper img {
  transform: scale(1.03);
}

.pin-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.pin-char-counter {
  font-size: 0.7rem;
  color: var(--text-dim);
  float: right;
  font-family: var(--font-mono);
}

.btn-pinterest {
  background: linear-gradient(135deg, #e60023 0%, #ad081b 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 14px rgba(230, 0, 35, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-pinterest:hover {
  background: linear-gradient(135deg, #f01438 0%, #bd091f 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(230, 0, 35, 0.5);
}

.pin-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.pin-status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pin-status-published {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bot-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.bot-login-btn.not-logged-in {
  background: rgba(230, 0, 35, 0.12) !important;
  color: #ff4760 !important;
  border: 1px solid rgba(230, 0, 35, 0.3) !important;
}

.bot-login-btn.not-logged-in:hover {
  background: rgba(230, 0, 35, 0.22) !important;
  border-color: rgba(230, 0, 35, 0.5) !important;
  transform: translateY(-1px);
}

.bot-login-btn.logged-in {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.bot-login-btn.logged-in:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: rgba(16, 185, 129, 0.65) !important;
  transform: translateY(-1px);
}

/* ============================================================ */
/* FACEBOOK REELS FARM STUDIO                                   */
/* ============================================================ */
.fb-farm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.75rem;
}

.fb-stat-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fb-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.fb-stat-pill.active {
  background: rgba(112, 119, 122, 0.15);
  border-color: rgba(112, 119, 122, 0.4);
  color: #B4BABD;
}

.fb-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.fb-page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.fb-page-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(112, 119, 122, 0.4);
}

.fb-page-item.selected {
  background: rgba(112, 119, 122, 0.12);
  border-color: rgba(112, 119, 122, 0.5);
}

.fb-page-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2E3033;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.fb-page-info {
  flex: 1;
  min-width: 0;
}

.fb-page-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #F2F0EA;
}

.fb-page-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.fb-queue-table-wrap {
  max-height: 380px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
}

.fb-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.fb-queue-table th {
  position: sticky;
  top: 0;
  background: #202122;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #A3A8AB;
  border-bottom: 1px solid var(--border-color);
  z-index: 1;
}

.fb-queue-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.fb-queue-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.fb-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.fb-status-pending {
  background: rgba(112, 119, 122, 0.15);
  color: #C9CCCE;
  border: 1px solid rgba(112, 119, 122, 0.3);
}

.fb-status-uploading {
  background: rgba(112, 119, 122, 0.2);
  color: #D3D6D8;
  border: 1px solid rgba(112, 119, 122, 0.4);
  animation: pulse 1.5s infinite;
}

.fb-status-scheduled {
  background: rgba(245, 158, 11, 0.18);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.fb-status-success {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.fb-status-error {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ============================================================== */
/* FLOATING FEEDBACK & SUPPORT WIDGET                             */
/* ============================================================== */
.floating-feedback-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 998;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-feedback-container.collapsed {
  right: 0 !important;
  bottom: 25% !important;
}

.feedback-pill-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-feedback-container.collapsed .feedback-pill-wrap {
  display: none !important;
}

.floating-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, #9A7B1C 0%, #8A6D14 50%, #ec4899 100%);
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(154, 123, 28, 0.5), 0 0 15px rgba(236, 72, 153, 0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.floating-feedback-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 30px -5px rgba(154, 123, 28, 0.65), 0 0 22px rgba(236, 72, 153, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

.floating-feedback-btn:active {
  transform: translateY(0) scale(0.98);
}

.feedback-btn-icon {
  font-size: 1.15rem;
  display: inline-flex;
}

.feedback-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  border: 2px solid rgba(236, 72, 153, 0.6);
  animation: feedbackRingPulse 2.2s infinite ease-out;
  pointer-events: none;
}

/* Nút X nhỏ để thu gọn */
.btn-collapse-feedback {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: #1e1b4b;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #e0e7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  z-index: 3;
}

.btn-collapse-feedback:hover {
  background: #ef4444;
  color: #fff;
  border-color: #fca5a5;
  transform: scale(1.2);
}

/* Nút < nép sát màn hình bên phải khi thu nhỏ */
.feedback-docked-handle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #9A7B1C 0%, #8A6D14 100%);
  color: #ffffff;
  padding: 0.65rem 0.55rem 0.65rem 0.75rem;
  border-radius: 14px 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-right: none;
  cursor: pointer;
  box-shadow: -4px 6px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(154, 123, 28, 0.4);
  transition: all 0.25s ease;
  user-select: none;
}

.floating-feedback-container.collapsed .feedback-docked-handle {
  display: inline-flex !important;
}

.feedback-docked-handle:hover {
  transform: translateX(-4px);
  background: linear-gradient(135deg, #4338ca 0%, #7A6115 100%);
  box-shadow: -6px 8px 25px rgba(0, 0, 0, 0.5), 0 0 18px rgba(154, 123, 28, 0.6);
}

.docked-arrow {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: #E2C76B;
  transition: transform 0.2s ease;
}

.feedback-docked-handle:hover .docked-arrow {
  transform: translateX(-2px);
  color: #ffffff;
}

.docked-icon {
  font-size: 1.1rem;
}

@keyframes feedbackRingPulse {
  0% {
    transform: scale(0.97);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

/* FEEDBACK MODAL BOX */
.feedback-modal-box {
  max-width: 620px;
  background: linear-gradient(145deg, #131929 0%, #1A1A1A 100%);
  border: 1px solid rgba(154, 123, 28, 0.3);
  border-radius: 22px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(181, 148, 16, 0.2);
}

.feedback-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.feedback-badge-top {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.feedback-title {
  font-family: var(--font-heading, inherit);
  font-size: 1.4rem;
  font-weight: 800;
  color: #F5F3EE;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #fff 40%, #E2C76B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feedback-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

.feedback-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .feedback-cards-grid {
    grid-template-columns: 1fr;
  }
}

.feedback-action-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.feedback-action-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(181, 148, 16, 0.4);
  transform: translateY(-2px);
}

.action-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-card-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #F2F0EA;
  margin-bottom: 0.35rem;
}

.action-card-body p {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.zalo-phone-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 104, 255, 0.1);
  border: 1px solid rgba(0, 104, 255, 0.25);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #D3D6D8;
  margin-bottom: 1rem;
}

.btn-copy-mini {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.68rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-copy-mini:hover {
  background: #70777A;
}

.form-tag {
  display: inline-block;
  font-size: 0.72rem;
  color: #D4B23A;
  background: rgba(181, 148, 16, 0.12);
  border: 1px solid rgba(181, 148, 16, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.btn-zalo {
  background: linear-gradient(135deg, #0068ff, #0084ff);
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 14px rgba(0, 104, 255, 0.4);
  transition: all 0.2s ease;
}

.btn-zalo:hover {
  background: linear-gradient(135deg, #0056d6, #0074e8);
  box-shadow: 0 6px 18px rgba(0, 104, 255, 0.6);
  transform: translateY(-1px);
}

.btn-gform {
  background: linear-gradient(135deg, #8A6D14, #9333ea);
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 14px rgba(154, 123, 28, 0.4);
  transition: all 0.2s ease;
}

.btn-gform:hover {
  background: linear-gradient(135deg, #7A6115, #7e22ce);
  box-shadow: 0 6px 18px rgba(154, 123, 28, 0.6);
  transform: translateY(-1px);
}

.feedback-footer-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   INSTAGRAM ANTI-DETECT FARM HUB & PROFILE MANAGER
   ========================================================================== */

/* KPI Metrics Farm Grid */
.ig-farm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 900px) {
  .ig-farm-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ig-farm-kpi-card {
  background: rgba(36, 37, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.ig-farm-kpi-card:hover {
  border-color: rgba(236, 72, 153, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ig-farm-kpi-card-action:hover {
  border-color: rgba(112, 119, 122, 0.7) !important;
  box-shadow: 0 8px 25px rgba(112, 119, 122, 0.25) !important;
  transform: translateY(-2px);
}

.ig-farm-kpi-card-action:active {
  transform: translateY(0);
}

.ig-farm-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ig-farm-kpi-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.ig-farm-kpi-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* ============================================================
   FARM PROFILES - CLEAN PROFESSIONAL SaaS ANTIDETECT DESIGN
   ============================================================ */

/* Farm Toolbar */
.ig-farm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: #242526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
}

.ig-farm-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Secondary Sub-toolbar: Search & Filter for Multi-Accounts */
.ig-farm-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.65rem;
  background: rgba(32, 33, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.ig-farm-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.farm-filter-pill {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #A3A8AB;
  cursor: pointer;
  transition: all 0.15s ease;
}

.farm-filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F5F3EE;
}

.farm-filter-pill.active {
  background: #5E6467;
  border-color: #5E6467;
  color: #ffffff;
  font-weight: 600;
}

/* Bulk Selection Action Bar */
.ig-farm-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: rgba(74, 77, 80, 0.12);
  border: 1px solid rgba(74, 77, 80, 0.3);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: #D3D6D8;
}

/* TABLE VIEW - OPTIMIZED FOR HUNDREDS OF ACCOUNTS */
.ig-farm-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #202122;
}

.ig-farm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.ig-farm-table th {
  background: #2E3033;
  color: #A3A8AB;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.ig-farm-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #E4E5E6;
  vertical-align: middle;
}

.ig-farm-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.ig-farm-table tr.selected td {
  background: rgba(74, 77, 80, 0.08);
}

/* Status Badges */
.badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.badge-expired {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.badge-proxy-die {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

/* CARD VIEW - CLEAN & COMPACT */
.ig-farm-card {
  background: #242526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s ease;
  position: relative;
}

.ig-farm-card:hover {
  border-color: rgba(112, 119, 122, 0.4);
  background: #131d31;
}

.ig-farm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ig-farm-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #2E3033;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #E4E5E6;
}

.ig-farm-dot-live {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #242526;
  border-radius: 50%;
}

.ig-farm-dot-die {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #ef4444;
  border: 2px solid #242526;
  border-radius: 50%;
}

.ig-farm-dot-unknown {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border: 2px solid #242526;
  border-radius: 50%;
}

.ig-farm-info-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.15rem;
  flex: 1;
}

.ig-farm-username {
  font-size: 0.9rem;
  font-weight: 600;
  color: #F5F3EE;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ig-farm-meta-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: #A3A8AB;
}

/* Proxy Box */
.ig-farm-proxy-box {
  background: #1E1E1E;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.ig-farm-proxy-text {
  color: #C5CACD;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Action Buttons */
.ig-farm-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

/* Button Open Chrome */
.btn-farm-browser {
  background: #5E6467;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #4A4D50;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-farm-browser:hover {
  background: #4A4D50;
}

.btn-farm-browser.is-running {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.btn-farm-browser.is-running:hover {
  background: #b91c1c !important;
}

/* Farm Modal Dialogs */
.ig-farm-modal-dialog {
  background: #0d1322;
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(236, 72, 153, 0.2);
  width: 95%;
  max-width: 580px;
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ig-farm-modal-header {
  padding: 1.15rem 1.4rem;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(154, 123, 28, 0.12));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ig-farm-modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.ig-farm-modal-tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.ig-farm-modal-tab-btn.active {
  color: #f472b6;
  border-bottom-color: #f472b6;
  background: rgba(236, 72, 153, 0.08);
}

.ig-farm-modal-body {
  padding: 1.25rem 1.4rem;
  max-height: 70vh;
  overflow-y: auto;
}

.ig-farm-modal-footer {
  padding: 0.95rem 1.4rem;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}



/* ==========================================================================
   PREMIUM THEME LAYER — Charcoal (#1A1A1A / #242526) · Dark Gold (#B59410 / #9A7B1C)
   · Gunmetal (#4A4D50 / #70777A). Chỉ ghi đè giao diện, không đổi logic.
   ========================================================================== */
:root {
  --gold: #B59410;
  --gold-deep: #9A7B1C;
  --gold-light: #D4B23A;
  --gold-soft: rgba(181, 148, 16, 0.12);
  --gold-line: rgba(181, 148, 16, 0.28);
  --gunmetal: #4A4D50;
  --gunmetal-light: #70777A;
  --charcoal: #1A1A1A;
  --charcoal-2: #242526;
  --charcoal-3: #2C2D2F;

  --bg-dark: var(--charcoal);
  --bg-card: linear-gradient(180deg, #26272A 0%, #222325 100%);
  --border-color: rgba(112, 119, 122, 0.22);
  --primary-glow: rgba(181, 148, 16, 0.22);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 6px 22px rgba(181, 148, 16, 0.28);
}

body {
  background-color: var(--charcoal);
  background-image:
    radial-gradient(1200px 600px at 0% -10%, rgba(181, 148, 16, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(112, 119, 122, 0.10), transparent 60%);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(181, 148, 16, 0.35); color: #fff; }
::-webkit-scrollbar-track { background: var(--charcoal); }
::-webkit-scrollbar-thumb { background: var(--gunmetal); border: 2px solid var(--charcoal); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

/* Header */
.app-header {
  background: rgba(26, 26, 26, 0.92);
  border-bottom: 1px solid var(--gold-line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  padding: 0.75rem 1.75rem;
}
.brand-logo {
  background: linear-gradient(145deg, #D4B23A 0%, #B59410 45%, #7A6115 100%);
  box-shadow: 0 0 0 1px rgba(212, 178, 58, 0.35), 0 6px 18px rgba(181, 148, 16, 0.25);
  color: #1A1A1A;
}
.brand-text h1 {
  background: linear-gradient(90deg, #F5F3EE 0%, #D4B23A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0.01em;
}
.brand-text p { color: var(--gunmetal-light); letter-spacing: 0.02em; }

.nav-tabs {
  background: var(--charcoal-2);
  border: 1px solid var(--border-color);
}
.nav-tab { font-size: 0.83rem; padding: 0.5rem 0.9rem; color: #A3A8AB; }
.nav-tab:hover { color: #F5F3EE; background: rgba(112, 119, 122, 0.14); }
.nav-tab.active {
  color: #1A1A1A !important;
  background: linear-gradient(135deg, #D4B23A 0%, #B59410 55%, #9A7B1C 100%);
  box-shadow: 0 0 0 1px rgba(212, 178, 58, 0.4), 0 4px 14px rgba(181, 148, 16, 0.25);
}

.status-pill {
  background: var(--charcoal-2);
  border-color: var(--border-color);
  color: #C9CCCE;
}

/* Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.35rem 1.4rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 1.4rem; right: 1.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 178, 58, 0.55), transparent);
  pointer-events: none;
}
.glass-card:hover { border-color: rgba(181, 148, 16, 0.32); }

.card-header {
  padding-bottom: 0.85rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid rgba(112, 119, 122, 0.16);
}
.card-title { font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; color: #F5F3EE; }
.card-badge {
  background: var(--gold-soft);
  color: var(--gold-light);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.65rem;
}

/* Forms */
.form-label { color: #B4B8BB; font-size: 0.78rem; letter-spacing: 0.01em; }
.form-input, .form-textarea, .form-select {
  background: #1C1C1D;
  border: 1px solid rgba(112, 119, 122, 0.30);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  font-size: 0.86rem;
  color: #F2F0EA;
}
.form-input::placeholder, .form-textarea::placeholder { color: #5E6467; }
.form-input:hover, .form-textarea:hover, .form-select:hover { border-color: rgba(112, 119, 122, 0.5); }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  background: #1E1E1F;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(181, 148, 16, 0.16);
}
.form-select option { background: #242526; color: #F2F0EA; }

/* Buttons */
.btn { border-radius: 9px; letter-spacing: 0.01em; }
.btn-primary {
  background: linear-gradient(135deg, #D4B23A 0%, #B59410 50%, #9A7B1C 100%) !important;
  color: #1A1A1A !important;
  border: 1px solid rgba(212, 178, 58, 0.55) !important;
  box-shadow: 0 4px 14px rgba(181, 148, 16, 0.22);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 8px 22px rgba(181, 148, 16, 0.32);
}
.btn-secondary {
  background: linear-gradient(180deg, #34363A 0%, #2B2C2F 100%);
  border: 1px solid rgba(112, 119, 122, 0.38);
  color: #E4E5E6;
}
.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3B3E42 0%, #313336 100%);
  border-color: rgba(181, 148, 16, 0.55);
  color: #F5F3EE;
}
.btn-sm { padding: 0.42rem 0.8rem; font-size: 0.76rem; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 0.95rem; }

/* Pills & sub-tabs */
.preset-pill { background: var(--charcoal-2); border-color: rgba(112, 119, 122, 0.3); color: #C9CCCE; }
.preset-pill:hover { background: var(--gold-soft); color: var(--gold-light); border-color: var(--gold-line); }
.preset-pill.active {
  background: linear-gradient(135deg, #D4B23A, #B59410);
  color: #1A1A1A;
  border-color: #D4B23A;
  font-weight: 600;
}
.subtab-btn.active {
  color: var(--gold-light) !important;
  border-color: var(--gold) !important;
}

/* Terminal / log */
.terminal-box {
  background: #161616 !important;
  border: 1px solid rgba(112, 119, 122, 0.25) !important;
}

/* Modals */
.modal-overlay { background: rgba(10, 10, 10, 0.72); }
.modal-content {
  background: linear-gradient(180deg, #27282B 0%, #1F2022 100%) !important;
  border: 1px solid var(--gold-line) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6) !important;
}

/* Links */
a { color: var(--gold-light); }
a:hover { color: #E2C76B; }

/* Layout spacing */
.main-content { max-width: 1400px; padding: 1.5rem 1.75rem 3rem; }
.dashboard-grid { gap: 1.5rem; }

@media (max-width: 1100px) {
  .app-header { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 1rem; }
  .main-content { padding: 1.25rem 1rem 2.5rem; }
}

/* ---------- Theme fixes v2: header gọn 1 hàng + nút hành động đồng bộ ---------- */
/* Header: 1 hàng, không xuống dòng chữ */
.app-header { gap: 1rem; padding: 0.6rem 1.25rem; flex-wrap: nowrap; }
.brand-section { gap: 0.7rem; flex-shrink: 0; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }
.brand-text h1 { font-size: 1.1rem; line-height: 1.2; white-space: nowrap; }
.brand-text p { font-size: 0.68rem; white-space: nowrap; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }

.nav-tabs { gap: 0.15rem; padding: 0.25rem; border-radius: 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  gap: 0.35rem;
  border-radius: 9px;
  color: #A3A8AB !important;          /* bỏ màu hồng/đỏ inline của tab Instagram/YouTube */
  flex-shrink: 0;
}
.nav-tab span { font-size: 0.9rem; filter: grayscale(0.35); }
.nav-tab:hover { color: #F5F3EE !important; }
.nav-tab.active { color: #1A1A1A !important; box-shadow: 0 3px 10px rgba(181, 148, 16, 0.25); }
.nav-tab.active span { filter: none; }
.nav-tab:focus { outline: none; }
.nav-tab:focus-visible { outline: 2px solid rgba(212, 178, 58, 0.6); outline-offset: 1px; }

.header-status { gap: 0.4rem; flex-shrink: 0; }
.status-pill { white-space: nowrap; font-size: 0.7rem; padding: 0.3rem 0.65rem; }

@media (max-width: 1280px) {
  .brand-text p { display: none; }
  .status-pill { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 1050px) {
  .app-header { flex-wrap: wrap; }
  .nav-tabs { order: 3; width: 100%; }
}

/* Nút "thành công" (Đăng / Xuất bản) -> Gold đậm đồng bộ theme, thay xanh lá */
.btn-success {
  background: linear-gradient(135deg, #D4B23A 0%, #B59410 50%, #9A7B1C 100%) !important;
  color: #1A1A1A !important;
  border: 1px solid rgba(212, 178, 58, 0.55) !important;
  box-shadow: 0 4px 14px rgba(181, 148, 16, 0.22) !important;
  font-weight: 700;
}
.btn-success:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 8px 22px rgba(181, 148, 16, 0.32) !important; }

/* Hàng nút Đăng đơn + Chạy Batch: không tràn, phân cấp rõ */
#btnPublishSingle, #btnAutopilotBatch {
  min-width: 0;
  white-space: normal;
  line-height: 1.3;
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
  min-height: 48px;
}
#btnAutopilotBatch {
  background: linear-gradient(180deg, #34363A 0%, #2B2C2F 100%) !important;
  color: #E2C76B !important;
  border: 1px solid #B59410 !important;
  box-shadow: none !important;
}
#btnAutopilotBatch:hover:not(:disabled) {
  background: rgba(181, 148, 16, 0.14) !important;
  color: #F5F3EE !important;
}

/* ---------- Status pills: nhỏ gọn, xếp trên/dưới ---------- */
.header-status {
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
}
.status-pill {
  font-size: 0.64rem;
  padding: 0.12rem 0.55rem;
  gap: 0.35rem;
  line-height: 1.35;
  border-radius: 6px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-pill .status-dot { width: 6px; height: 6px; flex-shrink: 0; }

/* TikTok coming soon */
.coming-soon-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; border-radius: 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
}

/* ---------- Header v4: 1 hàng duy nhất (logo | 9 tab | trạng thái) ở laptop/desktop ---------- */
.app-header {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand nav status";
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1.25rem;
}
.brand-section { grid-area: brand; }
.header-status { grid-area: status; }

.nav-tabs {
  grid-area: nav;
  justify-self: center;
  width: auto;
  max-width: 100%;
  flex-wrap: nowrap !important;
  justify-content: center;
  overflow: visible !important;
  min-width: 0;
}
.nav-tab {
  flex: 0 0 auto;
  justify-content: center;
  padding: 0.45rem 0.6rem;
  gap: 0.3rem;
}

/* Slogan: chỉ hiện khi màn đủ rộng, để nhường chỗ cho menu 1 hàng */
.brand-text p {
  display: none !important;
  white-space: nowrap;
}
@media (min-width: 1700px) {
  .brand-text p { display: block !important; }
  .nav-tab { padding: 0.5rem 0.8rem; gap: 0.4rem; }
}

/* Trạng thái: gọn, cắt bớt chữ dài (hover để xem đủ) */
.status-pill {
  max-width: 150px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Laptop 13–14" (1180–1440px): thu nhỏ tab một chút để vẫn giữ 1 hàng */
@media (max-width: 1440px) {
  .app-header { gap: 0.5rem 0.75rem; padding: 0.5rem 1rem; }
  .nav-tabs { gap: 0.1rem; }
  .nav-tab { font-size: 0.75rem; padding: 0.42rem 0.5rem; gap: 0.25rem; }
  .nav-tab span { font-size: 0.85rem; }
  .status-pill { max-width: 130px !important; }
}

/* Màn hẹp (<1180px): menu xuống hàng riêng, full chiều ngang */
@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand status" "nav nav";
  }
  .nav-tabs {
    justify-self: stretch;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap !important;
  }
  .nav-tab { flex: 1 1 auto; font-size: 0.78rem; }
}
@media (max-width: 640px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "status" "nav";
  }
  .header-status { flex-direction: row; flex-wrap: wrap; }
}
