/* ----------------------------------------------------
   DESIGN SYSTEM & VARIABLES
   ---------------------------------------------------- */
:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Color Palette */
  --bg-gradient-start: #090d16;
  --bg-gradient-end: #0f172a;
  
  --panel-bg: rgba(30, 41, 59, 0.45);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-hover-border: rgba(99, 102, 241, 0.25);
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.15);
  
  --color-emerald: #10b981; /* Green */
  --color-emerald-light: rgba(16, 185, 129, 0.15);
  
  --color-blue: #3b82f6; /* Blue */
  --color-blue-light: rgba(59, 130, 246, 0.15);
  
  --color-amber: #f59e0b; /* Amber */
  --color-amber-light: rgba(245, 158, 11, 0.15);
  
  --color-red: #ef4444; /* Red */
  --color-red-light: rgba(239, 68, 68, 0.15);
  
  --text-main: #f1f5f9; /* Slate 100 */
  --text-muted: #94a3b8; /* Slate 400 */
  --text-dark: #64748b; /* Slate 500 */
  
  --sidebar-width: 260px;
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ----------------------------------------------------
   CORE LAYOUT & RESET
   ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: radial-gradient(circle at top right, #1e1b4b, transparent 40%), 
              linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, .logo-icon, .stat-val {
  font-family: var(--font-display);
}

/* ----------------------------------------------------
   MAIN APP STRUCTURE
   ---------------------------------------------------- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.85);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2.5rem;
}

.logo-icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.menu-item:hover, .menu-item.active {
  color: var(--text-main);
  background: var(--color-primary-light);
}

.menu-item.active {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2), var(--shadow-glow);
}

.menu-item i {
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.menu-item:hover i, .menu-item.active i {
  color: var(--color-primary);
  transform: scale(1.05);
}

.sidebar-footer {
  margin-top: auto;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

/* Main Content Wrapper */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 2.5rem 3rem;
  max-width: 1400px;
}

/* Headers */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1.5rem;
}

.header-title h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ----------------------------------------------------
   PANELS & GLASSMORPHISM
   ---------------------------------------------------- */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-main);
  transition: var(--transition-smooth);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ----------------------------------------------------
   BUTTONS & INPUTS
   ---------------------------------------------------- */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

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

.btn-danger {
  background: var(--color-red-light);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: var(--color-red);
  color: #ffffff;
}

.btn:active {
  transform: translateY(1px);
}

.select-control, input[type="text"] {
  font-family: var(--font-primary);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.select-control:focus, input[type="text"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* ----------------------------------------------------
   STATS TILES
   ---------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-main);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--panel-hover-border);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon.blue { background: var(--color-blue-light); color: var(--color-blue); }
.stat-icon.emerald { background: var(--color-emerald-light); color: var(--color-emerald); }
.stat-icon.amber { background: var(--color-amber-light); color: var(--color-amber); }

.stat-info {
  overflow: hidden;
  flex-grow: 1;
}

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.1rem;
  color: var(--text-main);
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-emerald { color: var(--color-emerald); }
.font-semibold { font-weight: 600; }
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-sm { font-size: 0.95rem !important; }

/* ----------------------------------------------------
   TABLES
   ---------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th, .table td {
  padding: 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  font-size: 0.95rem;
}

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

/* ----------------------------------------------------
   TABS PANEL SYSTEM
   ---------------------------------------------------- */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* ----------------------------------------------------
   TOOLBARS
   ---------------------------------------------------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-search {
  position: relative;
  width: 300px;
}

.toolbar-search input {
  width: 100%;
  padding-left: 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.toolbar-filters {
  display: flex;
  gap: 0.75rem;
}

/* ----------------------------------------------------
   PRODUCTS GRID & CARDS
   ---------------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.col-span-all {
  grid-column: 1 / -1;
}

.product-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-main);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--panel-hover-border);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

.card-img-container {
  height: 180px;
  background: #1e293b;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-cover: cover;
  transition: var(--transition-smooth);
}

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

.card-img-placeholder {
  font-size: 2.5rem;
  color: var(--text-dark);
}

/* Badges on Card Image */
.card-badge-vph {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.card-badge-vph.low {
  background: rgba(245, 158, 11, 0.9);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.card-badge-vph.zero {
  background: rgba(100, 116, 139, 0.85);
  box-shadow: none;
}

.card-badge-category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-main);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--panel-border);
}

/* Card Body Content */
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8rem;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.4rem;
  margin-bottom: 1rem;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.card-location {
  font-size: 0.75rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-views-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.card-status-badge {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
}

.status-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.status-pill.inactive { background: var(--color-amber-light); color: var(--color-amber); }
.status-pill.deleted { background: var(--color-red-light); color: var(--color-red); }

/* ----------------------------------------------------
   CONFIG COMPONENT & UTILITIES
   ---------------------------------------------------- */
.dashboard-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.flex-1 { flex: 1 1 300px; }
.flex-1.2 { flex: 1.2 1 350px; }
.flex-2 { flex: 2 2 450px; }

.mt-medium { margin-top: 1rem; }
.mt-large { margin-top: 1.5rem; }
.mb-medium { margin-bottom: 1rem; }
.mb-large { margin-bottom: 1.5rem; }

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid button[type="submit"] {
  align-self: flex-start;
  width: auto;
}

@media (max-width: 768px) {
  .form-grid button[type="submit"] {
    align-self: stretch;
    width: 100%;
  }
}

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

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

.input-help {
  font-size: 0.75rem;
  color: var(--text-dark);
}

.keyword-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.keyword-item {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--panel-border);
  padding: 1rem;
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.keyword-item:hover {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--panel-hover-border);
}

.keyword-item-info h4 {
  font-size: 1rem;
  font-weight: 600;
}

.keyword-item-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Leaderboard Cells */
.table-title-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.table-link {
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.table-link:hover {
  color: var(--color-primary);
}

.badge-vph {
  background: var(--color-emerald-light);
  color: var(--color-emerald);
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.badge-vph.low {
  background: var(--color-amber-light);
  color: var(--color-amber);
}

.badge-vph.zero {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
}

/* ----------------------------------------------------
   MODALS
   ---------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #0f172a;
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 900px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-smooth);
}

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

.modal-body {
  padding: 2.5rem;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

.detail-img-box {
  background: #1e293b;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.detail-cat-badge {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.detail-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--panel-border);
}

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

.detail-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  white-space: pre-wrap;
}

.detail-chart-panel {
  grid-column: span 2;
  border-top: 1px solid var(--panel-border);
  padding-top: 2rem;
  margin-top: 1rem;
}

.chart-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
  margin-top: 1rem;
}

/* ----------------------------------------------------
   TOAST SYSTEM
   ---------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 0.8rem 1.25rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 250px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.toast.success { border-left: 3px solid var(--color-emerald); }
.toast.error { border-left: 3px solid var(--color-red); }
.toast.info { border-left: 3px solid var(--color-primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ----------------------------------------------------
   TREND TAGS COMPONENT
   ---------------------------------------------------- */
.trends-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trend-tag {
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--text-main);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.trend-tag:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.trend-tag i {
  color: #f43f5e;
  font-size: 0.9rem;
}

.trend-tag-vph {
  font-size: 0.75rem;
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 50px;
  font-weight: 700;
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN MEDIA QUERIES
   ---------------------------------------------------- */
@media (max-width: 1024px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-chart-panel {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    padding: 2rem 0.5rem;
    align-items: center;
  }
  .sidebar-brand span, .menu-item span, .sidebar-footer {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    margin-bottom: 2rem;
  }
  .menu-item {
    justify-content: center;
    padding: 0.75rem;
  }
  .main-content {
    margin-left: 70px;
    padding: 1.5rem;
  }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .header-actions {
    width: 100%;
  }
  .btn {
    width: 100%;
  }
}

/* ----------------------------------------------------
   BRAND LOGO & USER BADGE
   ---------------------------------------------------- */
.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-text-container {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-primary);
}

.user-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
}

.highlight-panel {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.price-settings-grid {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ----------------------------------------------------
   LOGIN OVERLAY MODAL
   ---------------------------------------------------- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.active {
  opacity: 1;
  visibility: visible;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-logo-img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
  margin-bottom: 0.5rem;
}

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hidden {
  display: none !important;
}

.login-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.8) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  padding: 0.85rem 1rem !important;
  font-size: 0.95rem !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3) !important;
  background: rgba(15, 23, 42, 0.95) !important;
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.login-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  justify-content: center;
}

/* ----------------------------------------------------
   PRODUCTS GRID & CARD LAYOUT
   ---------------------------------------------------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.2);
}

.card-media {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.card-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.card-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: auto;
}

.card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.card-metric.highlight {
  color: var(--color-emerald);
  font-weight: 700;
}

/* ----------------------------------------------------
   MODAL OVERLAY & PRODUCT DETAIL DIALOG
   ---------------------------------------------------- */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(11, 15, 25, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  box-sizing: border-box !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 900px !important;
  max-height: 90vh !important;
  background: rgba(17, 24, 39, 0.98) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.15) !important;
  overflow-y: auto !important;
  padding: 2.5rem 2rem 2rem 2rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
}

.modal-close {
  position: absolute !important;
  top: 1.25rem !important;
  right: 1.25rem !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #a5b4fc !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  font-size: 1.5rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  color: #f43f5e !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  transform: rotate(90deg);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

.detail-img-box {
  width: 100%;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.detail-cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  align-self: flex-start;
}

.detail-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-emerald);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.detail-chart-panel {
  grid-column: span 2;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-chart-panel h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card Seller Box - High contrast, framed, glow */
.card-seller-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin: 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.card-seller-box.seller-red {
  border-color: rgba(244, 63, 94, 0.6) !important;
  background: rgba(244, 63, 94, 0.1) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2) !important;
}

.card-seller-box.seller-orange {
  border-color: rgba(245, 158, 11, 0.6) !important;
  background: rgba(245, 158, 11, 0.1) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
}

.card-seller-box.seller-green {
  border-color: rgba(16, 185, 129, 0.45) !important;
  background: rgba(16, 185, 129, 0.08) !important;
}

.seller-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.seller-box-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.seller-age-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.seller-age-badge.age-red {
  background: rgba(244, 63, 94, 0.25);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.5);
}

.seller-age-badge.age-orange {
  background: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.seller-age-badge.age-green {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.seller-box-badges {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Seller Section in Product Modal */
.detail-seller-panel {
  grid-column: span 2;
  margin-top: 1rem;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.seller-card-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.seller-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.seller-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.seller-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.seller-card-title-row h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.seller-card-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.seller-history-box {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.seller-history-box h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Seller History Table in Modal - Fixed width, no horizontal scroll */
.seller-history-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.seller-history-table th, 
.seller-history-table td {
  padding: 0.6rem 0.4rem !important;
  font-size: 0.8rem !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* Последняя колонка (Статус) — разрешаем перенос */
.seller-history-table td:last-child,
.seller-history-table th:last-child {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

.seller-history-table th:nth-child(1), .seller-history-table td:nth-child(1) { width: 30%; }
.seller-history-table th:nth-child(2), .seller-history-table td:nth-child(2) { width: 18%; }
.seller-history-table th:nth-child(3), .seller-history-table td:nth-child(3) { width: 18%; }
.seller-history-table th:nth-child(4), .seller-history-table td:nth-child(4) { width: 14%; }
.seller-history-table th:nth-child(5), .seller-history-table td:nth-child(5) { width: 20%; }

.price-under-10-alert {
  background: rgba(244, 63, 94, 0.25) !important;
  color: #f43f5e !important;
  border: 1px solid rgba(244, 63, 94, 0.6) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3) !important;
  font-weight: 800 !important;
}

/* ---- Блок синхронизации на дашборде ---- */
.sync-panel {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sync-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.sync-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---- Дата публикации на карточке товара ---- */
.card-pub-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0.25rem 0 0.5rem 0;
}

.card-pub-date i {
  color: #6366f1;
  font-size: 0.72rem;
}
