/* SNEAT ADMIN THEME DESIGN SYSTEM & RESPONSIVE MOBILE STYLES */
:root {
  --sneat-bg: #f5f5f9;
  --sneat-card-bg: #ffffff;
  --sneat-sidebar-bg: #ffffff;
  
  --sneat-primary: #696cff;
  --sneat-primary-hover: #5f61e6;
  --sneat-primary-light: #e7e7ff;
  
  --sneat-secondary: #8592a3;
  --sneat-success: #71dd37;
  --sneat-info: #03c3ec;
  --sneat-warning: #ffab00;
  --sneat-danger: #ff3e1d;
  --sneat-dark: #233446;

  --sneat-text: #566a7f;
  --sneat-heading: #566a7f;
  --sneat-muted: #a1acb8;
  --sneat-border: #d9ade6;
  --sneat-border-light: #eceef1;

  --sneat-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
  --sneat-shadow-lg: 0 8px 24px 0 rgba(67, 89, 113, 0.15);

  --font-main: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Public Sans', sans-serif;
}

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

body.sneat-theme {
  font-family: var(--font-main);
  background-color: var(--sneat-bg);
  color: var(--sneat-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* LOGIN SCREEN STYLING */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e7e7ff 0%, #f5f5f9 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--sneat-card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--sneat-shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border: 1px solid rgba(105, 108, 255, 0.15);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}
.brand-logo {
  width: 42px;
  height: 42px;
  background: var(--sneat-primary);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(105, 108, 255, 0.4);
}
.login-brand h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--sneat-dark);
}
.login-brand h2 span { color: var(--sneat-primary); }

.login-header h3 {
  font-size: 1.25rem;
  color: var(--sneat-dark);
  margin-bottom: 0.35rem;
}
.login-header p {
  font-size: 0.88rem;
  color: var(--sneat-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sneat-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--sneat-muted);
  font-size: 1rem;
}
.input-with-icon input {
  width: 100%;
  padding: 0.75rem 2.8rem 0.75rem 2.6rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  background: #fafafa;
}
.input-with-icon input:focus {
  border-color: var(--sneat-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.15);
}
.pwd-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--sneat-muted);
  cursor: pointer;
  padding: 0.4rem;
}

.login-error-msg {
  background: rgba(255, 62, 29, 0.1);
  border: 1px solid rgba(255, 62, 29, 0.3);
  color: var(--sneat-danger);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.login-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--sneat-muted);
}

/* SNEAT DASHBOARD APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* SIDEBAR BACKDROP OVERLAY */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 52, 70, 0.5);
  backdrop-filter: blur(2px);
  z-index: 140;
  transition: opacity 0.3s ease;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: var(--sneat-sidebar-bg);
  border-right: 1px solid var(--sneat-border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 150;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sneat-dark);
}
.brand-name span { color: var(--sneat-primary); }
.btn-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--sneat-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-menu-wrapper {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
}
.menu-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sneat-muted);
  letter-spacing: 0.8px;
  padding: 0.5rem 0.85rem 0.2rem;
}
.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.menu-item .menu-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: var(--sneat-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.menu-item .menu-link:hover {
  background: rgba(105, 108, 255, 0.08);
  color: var(--sneat-primary);
}
.menu-item.active .menu-link {
  background: var(--sneat-primary-light);
  color: var(--sneat-primary);
  font-weight: 600;
}
.menu-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}
.badge-purple {
  margin-left: auto;
  background: var(--sneat-primary);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-weight: 700;
}

.sidebar-server-box {
  margin-top: auto;
  background: rgba(105, 108, 255, 0.06);
  border: 1px dashed rgba(105, 108, 255, 0.3);
  padding: 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
}
.server-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sneat-primary);
  margin-bottom: 0.2rem;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: var(--sneat-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--sneat-success);
}

/* MAIN WRAPPER */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* TOP FLOATING HEADER */
.top-header {
  margin: 1rem 1.5rem 0;
  background: var(--sneat-card-bg);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sneat-shadow);
  position: sticky;
  top: 1rem;
  z-index: 90;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.btn-hamburger {
  display: none;
  background: var(--sneat-primary-light);
  color: var(--sneat-primary);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--sneat-muted);
  width: min(620px, 100%);
  min-height: 42px;
  padding: 0.25rem 0.3rem 0.25rem 0.8rem;
  background: #f7f7fb;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.search-box:focus-within {
  background: white;
  border-color: rgba(105, 108, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.08);
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  min-width: 0;
  color: var(--sneat-text);
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-shortcut {
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 5px;
  background: white;
  color: var(--sneat-muted);
  font-family: inherit;
  font-size: 0.68rem;
  white-space: nowrap;
}
.search-submit-btn {
  height: 34px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 8px;
  background: var(--sneat-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.search-submit-btn:hover { background: var(--sneat-primary-hover); }
.search-submit-btn:disabled { opacity: 0.55; cursor: wait; }
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-icon-btn {
  background: transparent;
  border: none;
  color: var(--sneat-text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
}
.header-icon-btn:hover { color: var(--sneat-primary); }

.user-profile-dropdown {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--sneat-border-light);
}
.avatar-box {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
}
.avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: var(--sneat-success);
  border: 2px solid white;
  border-radius: 50%;
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sneat-dark);
}
.user-role {
  font-size: 0.72rem;
  color: var(--sneat-muted);
}
.btn-logout {
  background: rgba(255, 62, 29, 0.1);
  border: 1px solid rgba(255, 62, 29, 0.2);
  color: var(--sneat-danger);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-logout:hover {
  background: var(--sneat-danger);
  color: white;
}

/* CONTENT BODY */
.content-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* WELCOME HERO BANNER (Sneat Style) */
.welcome-banner {
  background: linear-gradient(135deg, #e7e7ff 0%, #dcdbff 100%);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sneat-shadow);
  position: relative;
  overflow: hidden;
}
.welcome-text h2 {
  font-family: var(--font-heading);
  color: var(--sneat-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.welcome-text p {
  color: #5658cf;
  font-size: 0.9rem;
  max-width: 600px;
  margin-bottom: 1.25rem;
}
.welcome-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.illustration-icon {
  font-size: 6rem;
  color: rgba(105, 108, 255, 0.25);
  margin-right: 1rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn-sneat-primary {
  background: var(--sneat-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(105, 108, 255, 0.35);
}
.btn-sneat-primary:hover {
  background: var(--sneat-primary-hover);
  transform: translateY(-1px);
}
.btn-sneat-light {
  background: white;
  color: var(--sneat-primary);
  box-shadow: var(--sneat-shadow);
}
.btn-sneat-light:hover {
  background: var(--sneat-primary-light);
}
.btn-sneat-outline {
  background: white;
  border: 1px solid var(--sneat-border-light);
  color: var(--sneat-text);
}
.btn-sneat-outline:hover {
  border-color: var(--sneat-primary);
  color: var(--sneat-primary);
}
.btn-block { width: 100%; }
.btn-full { width: 100%; padding: 0.75rem; }

/* SNEAT CARDS */
.sneat-card {
  background: var(--sneat-card-bg);
  border-radius: 12px;
  box-shadow: var(--sneat-shadow);
  overflow: hidden;
}
.card-body-padding { padding: 1.5rem; }
.card-header-clean {
  padding: 1.25rem 1.5rem 0.5rem;
}
.card-header-clean h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sneat-dark);
}
.card-header-flex {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sneat-dark);
}
.title-group p {
  font-size: 0.82rem;
  color: var(--sneat-muted);
}
.toolbar-actions { display: flex; gap: 0.75rem; }

/* SEARCH FORM */
.sneat-scrape-form .form-input-flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.input-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.input-container.flex-grow { flex: 1; min-width: 220px; }
.input-container.width-select { min-width: 180px; }
.input-container.width-btn { min-width: 150px; }
.input-container label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sneat-heading);
}
.input-container input, .input-container select {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: #fafafa;
}
.input-container input:focus, .input-container select:focus {
  border-color: var(--sneat-primary);
  background: white;
}
.extension-flow-note {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(105, 108, 255, 0.18);
  border-radius: 10px;
  background: rgba(105, 108, 255, 0.055);
  color: var(--sneat-primary);
}
.extension-flow-note > i {
  flex: 0 0 auto;
  font-size: 1rem;
}
.extension-flow-note div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}
.extension-flow-note strong {
  font-size: 0.76rem;
}
.extension-flow-note span {
  overflow: hidden;
  color: var(--sneat-text);
  font-size: 0.72rem;
  line-height: 1.4;
  text-overflow: ellipsis;
}

/* PERSISTENT SEARCH HISTORY */
.history-card {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem;
}
.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.history-header h3 {
  margin: 0.15rem 0 0.2rem;
  color: var(--sneat-dark);
  font-size: 1rem;
}
.history-header p,
.history-item small {
  color: var(--sneat-muted);
  font-size: 0.75rem;
}
.history-eyebrow {
  color: var(--sneat-primary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.history-count {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(105, 108, 255, 0.1);
  color: var(--sneat-primary);
  font-size: 0.7rem;
  font-weight: 700;
}
.history-list {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.1rem 0 0.35rem;
  scrollbar-width: thin;
}
.history-item {
  display: grid;
  flex: 0 0 210px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-height: 68px;
  padding: 0.7rem;
  border: 1px solid var(--sneat-border);
  border-radius: 12px;
  background: #fff;
  color: var(--sneat-text);
  text-align: left;
  cursor: pointer;
}
.history-item:hover,
.history-item.active {
  border-color: var(--sneat-primary);
  box-shadow: 0 5px 18px rgba(105, 108, 255, 0.1);
}
.history-item.active {
  background: rgba(105, 108, 255, 0.06);
}
.history-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #f2f1ff;
  color: var(--sneat-primary);
}
.history-item strong,
.history-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item strong {
  margin-bottom: 0.18rem;
  color: var(--sneat-dark);
  font-size: 0.82rem;
}
.history-empty {
  width: 100%;
  padding: 0.85rem;
  border: 1px dashed var(--sneat-border);
  border-radius: 10px;
  color: var(--sneat-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* SNEAT STATS CARDS GRID */
.sneat-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.sneat-stat-card {
  background: var(--sneat-card-bg);
  border-radius: 12px;
  padding: 1.3rem;
  box-shadow: var(--sneat-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.25s ease;
}
.sneat-stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.icon-bg-purple { background: var(--sneat-primary-light); color: var(--sneat-primary); }
.icon-bg-emerald { background: rgba(113, 221, 55, 0.15); color: #56ca00; }
.icon-bg-amber { background: rgba(255, 171, 0, 0.15); color: var(--sneat-warning); }
.icon-bg-blue { background: rgba(3, 195, 236, 0.15); color: var(--sneat-info); }

.stat-content {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--sneat-muted);
}
.stat-content h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sneat-dark);
  margin: 0.15rem 0;
}
.stat-badge { font-size: 0.75rem; font-weight: 600; }
.text-emerald { color: #56ca00; }
.text-purple { color: var(--sneat-primary); }
.text-blue { color: var(--sneat-info); }

/* CHARTS GRID */
.sneat-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}
.chart-card-full { grid-column: 1 / -1; }
.chart-wrapper {
  position: relative;
  height: 250px;
  padding: 1rem 1.5rem 1.5rem;
}

/* FILTERS TOOLBAR */
.filters-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1.5rem 1rem;
  align-items: center;
}
.filter-input-box {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
.filter-input-box i {
  position: absolute;
  left: 12px;
  color: var(--sneat-muted);
}
.filter-input-box input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.3rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
}
.filter-select-box select {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  background: white;
}
.view-toggle-group {
  display: flex;
  gap: 0.2rem;
  background: var(--sneat-bg);
  padding: 0.2rem;
  border-radius: 8px;
}
.btn-toggle {
  background: transparent;
  border: none;
  color: var(--sneat-muted);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}
.btn-toggle.active {
  background: white;
  color: var(--sneat-primary);
  box-shadow: var(--sneat-shadow);
}

/* SNEAT PRODUCT CARDS GRID */
.sneat-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem 1.5rem;
}
.product-card {
  background: white;
  border: 1px solid var(--sneat-border-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sneat-shadow-lg);
  border-color: rgba(105, 108, 255, 0.3);
}
.card-img-wrapper {
  position: relative;
  height: 170px;
  overflow: hidden;
  background: #f8f9fa;
}
.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-img-wrapper img.image-load-failed {
  display: none;
}
.product-image-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(145deg, #f5f5fb, #ececf7);
  color: var(--sneat-muted);
  font-size: 0.72rem;
}
.product-image-fallback i {
  color: var(--sneat-primary);
  font-size: 1.5rem;
  opacity: 0.55;
}
.product-image-fallback.show {
  display: flex;
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--sneat-danger);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.revenue-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #56ca00;
  border: 1px solid #56ca00;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 0.75rem;
}
.product-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sneat-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.current-price {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sneat-primary);
}
.sold-count {
  font-size: 0.78rem;
  color: var(--sneat-muted);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--sneat-text);
  border-top: 1px solid var(--sneat-border-light);
  padding-top: 0.6rem;
}
.rating-tag { color: var(--sneat-warning); font-weight: 600; }
.location-tag { display: flex; align-items: center; gap: 0.25rem; }
.shop-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: var(--sneat-muted);
  font-size: 0.72rem;
}
.shop-row i {
  flex: 0 0 auto;
  color: var(--sneat-primary);
}
.shop-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-shopee-link {
  width: 100%;
  background: rgba(238, 77, 45, 0.08);
  border: 1px solid rgba(238, 77, 45, 0.3);
  color: #ee4d2d;
  font-size: 0.8rem;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.btn-shopee-link:hover {
  background: #ee4d2d;
  color: white;
}
.table-image-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
}
.table-image-wrap img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--sneat-border-light);
}
.table-image-wrap img.image-load-failed {
  display: none;
}
.table-image-fallback {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--sneat-primary-light);
  color: var(--sneat-primary);
}
.table-image-fallback.show {
  display: inline-flex;
}
.empty-review-state {
  padding: 1rem;
  border: 1px dashed var(--sneat-border-light);
  border-radius: 8px;
  color: var(--sneat-muted);
  font-size: 0.82rem;
  text-align: center;
}

/* SNEAT TABLE STYLING */
.table-responsive {
  overflow-x: auto;
  padding: 0 1.5rem 1.5rem;
}
.sneat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.sneat-table th {
  background: #f9fafb;
  padding: 0.85rem 1rem;
  color: var(--sneat-muted);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--sneat-border-light);
}
.sneat-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sneat-border-light);
  vertical-align: middle;
}
.sneat-table tbody tr { cursor: pointer; }
.sneat-table tbody tr:hover { background: rgba(105, 108, 255, 0.04); }

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 52, 70, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-card {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 650px;
  box-shadow: var(--sneat-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-card.modal-lg {
  max-width: 820px;
  max-height: 90vh;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sneat-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { display: flex; align-items: center; gap: 0.5rem; }
.modal-title h3 { font-size: 1.1rem; font-family: var(--font-heading); color: var(--sneat-dark); }
.close-btn { background: transparent; border: none; font-size: 1.5rem; color: var(--sneat-muted); cursor: pointer; }

.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.modal-scrollable { overflow-y: auto; }

/* MODAL DETAIL CONTENT */
.detail-product-header { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.detail-img-box {
  width: 150px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--sneat-border-light);
}
.detail-img-box img { width: 100%; height: 100%; object-fit: cover; }
.detail-main-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 0.4rem; }
.detail-tags { display: flex; gap: 0.5rem; }
.sneat-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 4px; }
.bg-rose { background: rgba(255, 62, 29, 0.15); color: var(--sneat-danger); }
.bg-purple-light { background: var(--sneat-primary-light); color: var(--sneat-primary); }

.detail-price-box { display: flex; align-items: baseline; gap: 0.6rem; margin-top: 0.2rem; }
.detail-price-current { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--sneat-primary); }
.detail-price-old { font-size: 0.9rem; color: var(--sneat-muted); text-decoration: line-through; }

.btn-shopee-direct {
  background: linear-gradient(135deg, #ee4d2d 0%, #ff7337 100%);
  color: white;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(238, 77, 45, 0.35);
  align-self: flex-start;
  margin-top: 0.5rem;
}
.detail-sync-hint {
  max-width: 430px;
  margin: 0.1rem 0 0;
  color: var(--sneat-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}
.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.detail-sync-status {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #f1f2f6;
  color: var(--sneat-muted);
  font-size: 0.65rem;
  font-weight: 650;
}
.detail-sync-status.synced {
  background: rgba(113, 221, 55, 0.13);
  color: #3f8b16;
}
.product-type-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.75rem 0;
}
.product-type-row > div,
.product-description-box {
  padding: 0.75rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 9px;
  background: #fafafa;
}
.product-type-row span,
.product-description-box > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--sneat-muted);
  font-size: 0.65rem;
  font-weight: 650;
}
.product-type-row strong {
  color: var(--sneat-dark);
  font-size: 0.78rem;
}
.product-description-box p {
  max-height: 150px;
  overflow-y: auto;
  margin: 0;
  color: var(--sneat-text);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-line;
}
.product-intelligence h5 {
  margin: 0.8rem 0 0.45rem;
  color: var(--sneat-dark);
  font-size: 0.78rem;
}
.specification-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}
.specification-item,
.variant-item {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  background: #fff;
}
.specification-item span,
.variant-meta {
  color: var(--sneat-muted);
  font-size: 0.66rem;
}
.specification-item strong,
.variant-item strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--sneat-dark);
  font-size: 0.73rem;
}
.variant-list {
  display: grid;
  gap: 0.45rem;
}
.variant-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
}
.variant-item.best {
  border-color: rgba(113, 221, 55, 0.45);
  background: rgba(113, 221, 55, 0.055);
}
.variant-sales {
  color: var(--sneat-success);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.detail-empty {
  padding: 0.65rem;
  border: 1px dashed var(--sneat-border-light);
  border-radius: 8px;
  color: var(--sneat-muted);
  font-size: 0.7rem;
  text-align: center;
}

.divider { border: none; border-top: 1px solid var(--sneat-border-light); }

.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}
.detail-metric-box {
  background: #f8f9fa;
  border: 1px solid var(--sneat-border-light);
  padding: 0.85rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.margin-info-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 171, 0, 0.1);
  border: 1px solid rgba(255, 171, 0, 0.3);
  padding: 0.85rem;
  border-radius: 8px;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.profit-calculator {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(105, 108, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(105, 108, 255, 0.045), #fff 38%);
}
.profit-calculator-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.profit-calculator-header h4 {
  margin: 0.2rem 0;
}
.profit-calculator-header p,
.profit-note {
  color: var(--sneat-muted);
  font-size: 0.72rem;
}
.profit-rate-date {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #f0efff;
  color: var(--sneat-primary);
  font-size: 0.65rem;
  font-weight: 700;
}
.profit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.profit-form label {
  display: grid;
  gap: 0.3rem;
  color: var(--sneat-text);
  font-size: 0.68rem;
  font-weight: 650;
}
.profit-form input,
.profit-form select {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--sneat-dark);
  font: inherit;
  font-size: 0.75rem;
  outline: none;
}
.profit-form input:focus,
.profit-form select:focus {
  border-color: var(--sneat-primary);
  box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.1);
}
.profit-save-button {
  align-self: end;
  min-height: 38px;
}
.profit-results {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 0.85rem;
  margin-top: 0.9rem;
}
.profit-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
  padding: 0.8rem;
  border: 1px solid var(--sneat-border-light);
  border-radius: 10px;
  background: #fff;
}
.profit-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--sneat-muted);
  font-size: 0.7rem;
}
.profit-breakdown strong {
  color: var(--sneat-dark);
  white-space: nowrap;
}
.profit-net-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #696cff, #8d78ff);
  color: #fff;
}
.profit-net-card > span,
.profit-monthly span {
  font-size: 0.68rem;
  opacity: 0.86;
}
.profit-net-card > strong {
  margin: 0.2rem 0;
  font-size: 1.35rem;
}
.profit-net-card > small {
  font-size: 0.72rem;
}
.profit-net-card.loss {
  background: linear-gradient(135deg, #d9344c, #f26a5b);
}
.profit-monthly {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.profit-note {
  margin: 0.7rem 0 0;
}
.profit-note.success {
  color: var(--sneat-success);
}
.profit-note.error {
  color: var(--sneat-danger);
}

.reviews-summary-wrapper {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: #f8f9fa;
  padding: 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--sneat-border-light);
}
.rating-overall-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 1.2rem;
  border-right: 1px solid var(--sneat-border-light);
  min-width: 130px;
}
.rating-overall-box h2 { font-family: var(--font-heading); font-size: 2.4rem; color: var(--sneat-warning); }
.stars-row { color: var(--sneat-warning); font-size: 0.85rem; margin: 0.3rem 0; }

.rating-bars-box { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.35rem; }
.rating-bar-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; }
.bar-bg { flex: 1; height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--sneat-warning); }

.comments-container { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.comment-card {
  background: #f8f9fa;
  border: 1px solid var(--sneat-border-light);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.progress-bar-container { width: 100%; height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { width: 15%; height: 100%; background: var(--sneat-primary); transition: width 0.4s ease; }
.terminal-log-console {
  background: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
  height: 230px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.82rem;
}
.log-line.info { color: #60a5fa; }
.log-line.success { color: #34d399; }
.log-line.warning { color: #fbbf24; }
.log-line.error { color: #f87171; }

.hidden { display: none !important; }
.sneat-footer { text-align: center; padding: 1.5rem; font-size: 0.82rem; color: var(--sneat-muted); }

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (@media max-width: 991px & 576px)
   ========================================================================== */

@media (max-width: 991px) {
  /* Hide sidebar off-screen by default on mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--sneat-shadow-lg);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  
  /* Main wrapper takes full width on mobile */
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Show Hamburger toggle button */
  .btn-hamburger {
    display: flex !important;
  }

  /* Header adjustments */
  .top-header {
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 0;
    top: 0;
    gap: 0.55rem;
  }
  .header-left {
    gap: 0.5rem;
  }
  .search-box {
    width: 100%;
    min-height: 38px;
  }
  .search-shortcut {
    display: none;
  }
  .header-right {
    gap: 0;
  }
  .header-icon-btn,
  .avatar-box {
    display: none;
  }
  .user-profile-dropdown {
    padding-left: 0;
    border-left: 0;
  }
  .btn-logout {
    width: 34px;
    height: 34px;
  }
  .mobile-hide {
    display: none !important;
  }

  /* Content body padding */
  .content-body {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  /* Welcome Banner */
  .welcome-banner {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .welcome-text h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
  }
  .welcome-text p {
    font-size: 0.78rem;
    line-height: 1.45;
    margin-bottom: 0.75rem;
  }
  .welcome-actions {
    gap: 0.45rem;
  }
  .welcome-actions .btn {
    padding: 0.48rem 0.65rem;
    font-size: 0.73rem;
  }

  /* Advanced search stays compact: keyword full width, options side by side. */
  .search-card .card-body-padding {
    padding: 0.85rem;
  }
  .sneat-scrape-form .form-input-flex {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .input-container.flex-grow {
    grid-column: 1 / -1;
  }
  .input-container.flex-grow, 
  .input-container.width-select, 
  .input-container.width-btn {
    width: 100% !important;
    min-width: 0 !important;
  }
  .input-container {
    gap: 0.3rem;
  }
  .input-container label {
    font-size: 0.7rem;
  }
  .input-container input,
  .input-container select {
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
  }
  .btn-full {
    min-height: 40px;
    padding: 0.55rem;
  }
  .extension-flow-note {
    align-items: flex-start;
    margin-top: 0.65rem;
    padding: 0.6rem 0.7rem;
  }
  .extension-flow-note strong {
    font-size: 0.69rem;
  }
  .extension-flow-note span {
    display: -webkit-box;
    font-size: 0.65rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* Stats grid on mobile */
  .sneat-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .sneat-stat-card {
    min-width: 0;
    padding: 0.7rem;
    gap: 0.5rem;
  }
  .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  .stat-content {
    min-width: 0;
  }
  .stat-label {
    font-size: 0.68rem;
    line-height: 1.25;
  }
  .stat-content h3 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    white-space: nowrap;
  }
  .stat-badge {
    display: none;
  }

  /* Charts grid */
  .sneat-charts-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .chart-wrapper {
    height: 210px;
    padding: 0.75rem;
  }
  .card-header-clean {
    padding: 0.9rem 0.9rem 0.2rem;
  }
  .card-header-clean h4 {
    font-size: 0.85rem;
  }

  /* Catalog Toolbar & Product Grid */
  .card-header-flex {
    padding: 0.9rem;
    gap: 0.65rem;
  }
  .title-group h3 {
    font-size: 0.95rem;
  }
  .title-group p {
    font-size: 0.72rem;
  }
  .toolbar-actions {
    width: 100%;
    gap: 0.5rem;
  }
  .toolbar-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.72rem;
  }
  .filters-toolbar {
    padding: 0 0.9rem 0.75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .filter-input-box {
    grid-column: 1 / -1;
  }
  .filter-input-box, .filter-select-box {
    width: 100%;
    min-width: 0;
  }
  .filter-input-box input,
  .filter-select-box select {
    width: 100%;
    min-width: 0;
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
    font-size: 0.75rem;
  }
  .view-toggle-group {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .sneat-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    padding: 0 0.9rem 0.9rem;
  }
  .card-img-wrapper {
    height: 128px;
  }
  .card-body {
    padding: 0.65rem;
    gap: 0.42rem;
  }
  .product-title {
    font-size: 0.8rem;
  }
  .current-price {
    font-size: 0.9rem;
  }
  .sold-count,
  .meta-row {
    font-size: 0.68rem;
  }
  .revenue-badge {
    bottom: 7px;
    right: 7px;
    font-size: 0.62rem;
  }
  .btn-shopee-link {
    padding: 0.42rem 0.3rem;
    font-size: 0.68rem;
  }
}

@media (max-width: 576px) {
  .history-card {
    margin-bottom: 0.85rem;
    padding: 0.85rem;
  }
  .history-header {
    margin-bottom: 0.65rem;
  }
  .history-header p {
    display: none;
  }
  .history-item {
    flex-basis: 175px;
    min-height: 60px;
    padding: 0.55rem;
  }
  .btn-hamburger {
    width: 34px;
    height: 34px;
  }
  .search-box {
    padding-left: 0.65rem;
    gap: 0.45rem;
  }
  .search-box input {
    font-size: 0.78rem;
  }
  .search-submit-btn {
    width: 34px;
    padding: 0;
  }
  .search-submit-btn span {
    display: none;
  }
  .welcome-banner {
    padding: 0.8rem;
  }
  .welcome-text p {
    display: none;
  }
  .welcome-actions {
    margin-top: 0.45rem;
  }
  .sneat-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sneat-stat-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  .card-img-wrapper {
    height: 116px;
  }
  .location-tag {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rating-overall-box {
    border-right: none;
    border-bottom: 1px solid var(--sneat-border-light);
    padding-right: 0;
    padding-bottom: 0.75rem;
    width: 100%;
  }
  .reviews-summary-wrapper {
    flex-direction: column;
  }
  .profit-calculator {
    padding: 0.75rem;
  }
  .profit-calculator-header p,
  .profit-rate-date {
    display: none;
  }
  .profit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profit-results,
  .profit-breakdown {
    grid-template-columns: 1fr;
  }
  .profit-save-button {
    grid-column: 1 / -1;
  }
  .detail-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .product-type-row,
  .specification-grid {
    grid-template-columns: 1fr;
  }
  .variant-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .variant-item .variant-meta {
    grid-column: 1 / -1;
  }
}
