/* ============================================================
   BOT SOPI DASHBOARD — Premium Dark Theme
   ============================================================ */

:root, [data-theme="dark"] {
  /* Core palette - Exact match with port 3003 Gopal Digital Store Dark Mode */
  --bg-primary: #121212;
  --bg-secondary: #181818;
  --bg-card: #1e1e1e;
  --bg-card-hover: #262626;
  --bg-input: #2d2d2d;

  /* Dedicated Sidebar in Dark Mode - Sleek Charcoal with physical separation */
  --bg-sidebar: #161616;
  --sidebar-border: #262626;
  --sidebar-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  --sidebar-text: #ffffff;
  --sidebar-text-muted: #94a3af;
  --sidebar-hover: rgba(255, 255, 255, 0.06);

  /* Borders */
  --border: #333333;
  --border-hover: #4b5563;

  /* Text */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Accent colors - Modern Blue Theme (from port 3003) */
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.35);

  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.15);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.15);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.15);
  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.15);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.15);
  --yellow: #f59e0b;

  /* Sizes */
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;

  /* Dedicated Sidebar in Light Mode - Clean White & Dark Text */
  --bg-sidebar: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
  --sidebar-text: #0f172a;
  --sidebar-text-muted: #64748b;
  --sidebar-hover: rgba(0, 0, 0, 0.04);

  --border: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============ GLOBAL LAYOUT ============ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.4s ease;
}

.btn-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: var(--sidebar-shadow);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  color: var(--sidebar-text);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  transition: border-color var(--transition);
}

.logo-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  flex-shrink: 0;
}

.logo-icon img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 195, 255, 0.45));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo-icon:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 16px rgba(0, 195, 255, 0.65));
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.logo-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--sidebar-text);
  letter-spacing: -0.3px;
  line-height: 1.15;
  transition: color var(--transition);
}

.logo-subtitle {
  font-size: 11.5px;
  color: var(--sidebar-text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
  transition: color var(--transition);
}

.sidebar-menu {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition);
}

.menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.menu-item.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.menu-item.active::before {
  height: 24px;
  background: #ffffff;
}

.menu-item.active .menu-icon {
  color: #ffffff;
}

.menu-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: all var(--transition);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  transition: border-color var(--transition);
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--sidebar-text-muted);
  font-weight: 500;
  transition: color var(--transition);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s infinite;
}

.status-dot.offline {
  background: var(--text-muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ MOBILE HEADER ============ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--sidebar-border);
  z-index: 90;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  transition: background var(--transition), border-color var(--transition);
}

.hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sidebar-text);
  border-radius: 1px;
  transition: all var(--transition);
}

.mobile-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--sidebar-text);
  transition: color var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 95;
  backdrop-filter: blur(4px);
}

/* ============ MAIN CONTENT ============ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
  min-height: 100vh;
}

.page {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page.active {
  display: block;
}

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

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }
.stat-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-purple .stat-icon { background: var(--purple-bg); color: var(--purple); }
.stat-orange .stat-icon { background: var(--orange-bg); color: var(--orange); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* ============ CONTENT CARD ============ */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

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

.card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============ BOT CONTROL ============ */
.bot-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.bot-status-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bot-status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.bot-status-icon.offline {
  background: var(--red-bg);
  color: var(--red);
}

.bot-status-icon.online {
  background: var(--green-bg);
  color: var(--green);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

.bot-status-text {
  display: flex;
  flex-direction: column;
}

.bot-status-title {
  font-size: 16px;
  font-weight: 700;
}

.bot-status-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.bot-actions {
  display: flex;
  gap: 10px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover), #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

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

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-outline.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition);
}

.form-textarea {
  word-break: break-all;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

/* ============ DATA TABLE ============ */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--transition);
}

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

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active {
  background: var(--green-bg);
  color: var(--green);
}

.badge-invalid {
  background: var(--red-bg);
  color: var(--red);
}

.badge-processed {
  background: var(--blue-bg);
  color: var(--blue);
}

/* ============ PRODUCTS GRID ============ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.product-card.cat-capcut::before { background: linear-gradient(90deg, var(--purple), var(--accent)); }
.product-card.cat-canva::before { background: linear-gradient(90deg, var(--blue), #06b6d4); }
.product-card.cat-pulsa::before { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.product-card.cat-general::before { background: linear-gradient(90deg, var(--green), #14b8a6); }

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.product-icon.has-cover-image {
  overflow: hidden;
  padding: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.product-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  transition: transform 0.25s ease;
}

.product-card:hover .product-cover-img {
  transform: scale(1.08);
}

.product-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-file {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 16px;
}

.product-stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.stock-count {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}

.stock-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stock-count.low { color: var(--red); }
.stock-count.medium { color: var(--orange); }
.stock-count.high { color: var(--green); }

/* ============ MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}

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

.modal {
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s ease;
}

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

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal-body {
  box-sizing: border-box;
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* ============ LOGS ============ */
.logs-container {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  transition: background var(--transition);
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

.log-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.log-badge.info { background: var(--blue-bg); color: var(--blue); }
.log-badge.error { background: var(--red-bg); color: var(--red); }
.log-badge.chat { background: var(--purple-bg); color: var(--purple); }
.log-badge.warning { background: var(--orange-bg); color: var(--orange); }

.log-message {
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.4;
}

.log-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* =============================================================
   SETTINGS PAGE — Android Dark Style (Menu/Submenu)
   ============================================================= */

#page-settings {
  background: transparent;
}

.settings-page {
  max-width: 720px;
  margin: 0;
}

/* Settings view toggle (menu/submenu) */
.settings-view {
  display: none;
  animation: fadeIn 0.35s ease;
}

.settings-view.active {
  display: block;
}

/* Main Menu Items (Android list style) */
.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.settings-menu-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.settings-menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-menu-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.settings-menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.settings-menu-info {
  flex: 1;
  min-width: 0;
}

.settings-menu-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-menu-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-menu-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Header */
.settings-header {
  margin-bottom: 28px;
}

.settings-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.settings-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.settings-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  transition: all var(--transition);
  padding: 6px 0;
}

.settings-back-btn:hover {
  color: var(--accent);
  gap: 10px;
}

/* Sections */
.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Dark Card Container */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

/* Individual setting item with chevron */
.setting-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: background 0.15s ease;
  cursor: default;
  position: relative;
}

.setting-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.setting-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Colored circular icons (Android style) */
.setting-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

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

.setting-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chevron arrow on right side */
.setting-item .setting-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 4px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--text-muted);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

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

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Setting value input */
.setting-value-input {
  width: 80px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition);
}

.setting-value-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============ KEYWORDS ============ */
.keyword-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  transition: background 0.15s ease;
}

.keyword-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.keyword-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.keyword-badge {
  padding: 4px 12px;
  background: var(--accent-glow);
  color: var(--accent-hover);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.keyword-response {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.keyword-add-form {
  padding: 20px;
}

.keyword-form-row {
  display: flex;
  gap: 12px;
}

/* Settings-specific form inputs (dark theme) */
.s-form-group {
  flex: 1;
  margin-bottom: 10px;
}

.s-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.s-form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition);
}

.s-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.s-form-input::placeholder {
  color: var(--text-muted);
}

/* Settings-specific buttons */
.s-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.s-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.s-btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.s-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* ============ BACKUP & RESTORE ============ */
.backup-card {
  margin-bottom: 12px;
  border-left: 4px solid var(--accent) !important;
}

.restore-card {
  border-left: 4px solid var(--red) !important;
}

.backup-item {
  display: flex;
  gap: 18px;
  padding: 22px 20px;
  align-items: flex-start;
}

.backup-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.backup-icon-circle.download {
  background: var(--blue-bg);
  color: var(--blue);
}

.backup-icon-circle.restore {
  background: var(--red-bg);
  color: var(--red);
}

.backup-info {
  flex: 1;
}

.backup-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.backup-title.restore-text {
  color: var(--red) !important;
}

.backup-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.restore-warning {
  color: var(--red);
  font-weight: 600;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease forwards;
  animation-delay: 0s, 3s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast-info { background: linear-gradient(135deg, var(--accent), #1d4ed8); }

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

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

/* ============ DROPDOWN ============ */
.dropdown-menu {
  animation: fadeIn 0.2s ease;
}

.dropdown-item {
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ============ BROWSER LOGIN STEPS ============ */
.login-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.login-step.active {
  display: block;
}

.login-step kbd {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

/* ============ PAGINATION ============ */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-info strong {
  color: var(--text-secondary);
  font-weight: 600;
}

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

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.pagination-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 36px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  user-select: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 14px 24px;
  }

  .content-card {
    padding: 16px;
  }

  /* Compact button styling on mobile */
  .btn {
    min-height: 44px; /* Touch target size */
  }
  
  .btn-sm {
    min-height: 36px;
  }

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

  .bot-control-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .keyword-form-row, .form-row {
    flex-direction: column;
    gap: 8px; /* Reduce gap on mobile */
  }

  .settings-title {
    font-size: 26px;
  }

  .pagination-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .pagination-btn {
    min-width: 34px;
    height: 34px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .modal {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-header, .modal-footer {
    padding: 16px;
  }
  
  .modal-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  
  .modal-footer .btn {
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }
.drag-handle { cursor: grab; color: #a1a1aa; padding: 4px; display: inline-flex; align-items: center; justify-content: center; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.5; background-color: #f3f4f6; }

/* Nomor Pesanan helpers */
.btn-copy-sn:hover {
  background: var(--blue-bg) !important;
  color: var(--blue) !important;
}

button.loading svg {
  animation: np-spin 1s linear infinite;
}

@keyframes np-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
