/* ==========================================
   DIAROSSA ENVANTER - DESIGN SYSTEM
   ========================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary Colors */
  --primary: #6d28d9;
  --primary-light: #8b5cf6;
  --primary-dark: #4c1d95;
  --primary-glow: rgba(109, 40, 217, 0.2);

  /* Accent Colors */
  --accent-blue: #2563eb;
  --accent-cyan: #0891b2;
  --accent-green: #059669;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --accent-pink: #db2777;

  /* Background Colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-sidebar: #ffffff;
  --bg-input: rgba(0, 0, 0, 0.03);
  --bg-overlay: rgba(15, 23, 42, 0.4);

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #6d28d9;

  /* Border */
  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-light: rgba(0, 0, 0, 0.1);

  /* Marketplace Colors */
  --woo-color: #96588a;
  --trendyol-color: #f27a1a;
  --amazon-color: #ff9900;
  --temu-color: #fb7701;

  /* Spacing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

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

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(109, 40, 217, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(8, 145, 178, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-light);
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ---------- Layout ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-normal), transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  min-height: 70px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-brand span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.collapsed .sidebar-brand {
  display: none;
}

.notification-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: auto;
}

.notification-btn:hover {
  background: rgba(109, 40, 217, 0.1);
  color: var(--primary);
}

.notification-btn.enabled {
  color: var(--accent-green);
}

.pwa-btn {
  margin-left: 0;
  color: var(--accent-orange);
}

.pwa-btn:hover {
  background: rgba(217, 119, 6, 0.1);
  color: var(--accent-orange);
}

.sidebar.collapsed .notification-btn {
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  font-weight: 600;
}

.collapsed .nav-section-title {
  text-align: center;
  font-size: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(124, 58, 237, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(37, 99, 235, 0.05));
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item i,
.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.collapsed .nav-item span {
  display: none;
}

.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.collapsed .nav-item .badge {
  display: none;
}

/* Marketplace dot colors */
.nav-item .mp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mp-dot.woo {
  background: var(--woo-color);
}

.mp-dot.trendyol {
  background: var(--trendyol-color);
}

.mp-dot.amazon {
  background: var(--amazon-color);
}

.mp-dot.temu {
  background: var(--temu-color);
}

/* Sidebar toggle */
.sidebar-toggle {
  position: absolute;
  top: 24px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 101;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 99;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.page-header-left p {
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.breadcrumb span {
  color: var(--text-secondary);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-color-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-card.purple::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.stat-card.blue::before {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
}

.stat-card.green::before {
  background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.stat-card.orange::before {
  background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
}

.stat-card.pink::before {
  background: linear-gradient(90deg, var(--accent-pink), #f472b6);
}

.stat-card.red::before {
  background: linear-gradient(90deg, var(--accent-red), #f87171);
}

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

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon.purple {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

.stat-card-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.stat-card-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.stat-card-icon.orange {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.stat-card-icon.pink {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink);
}

.stat-card-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.stat-change.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.stat-change.down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ---------- Cards / Panels ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-color-light);
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-body.no-padding {
  padding: 0;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
}

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

table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.02);
}

table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table tr:hover td {
  background: rgba(109, 40, 217, 0.02);
}

table tr:last-child td {
  border-bottom: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.woo {
  background: rgba(150, 88, 138, 0.2);
  color: #c97fbb;
}

.badge.trendyol {
  background: rgba(242, 122, 26, 0.2);
  color: #f5a05c;
}

.badge.amazon {
  background: rgba(255, 153, 0, 0.2);
  color: #ffb84d;
}

.badge.temu {
  background: rgba(251, 119, 1, 0.2);
  color: #fc9940;
}

.badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.badge.info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.badge.purple {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status.active::before {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.status.pending::before {
  background: var(--accent-orange);
  box-shadow: 0 0 6px var(--accent-orange);
}

.status.inactive::before {
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

.status.synced::before {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-color-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

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

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

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

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

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

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

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

/* Search input */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 38px;
}

.search-box svg,
.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .search-box {
  flex: 1;
  min-width: 200px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  padding: 20px;
}

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

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-normal);
}

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

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

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

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}

/* ---------- Product Image ---------- */
.product-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
}

.product-img-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
}

/* ---------- Charts ---------- */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container.small {
  height: 200px;
}

/* ---------- Notifications / Alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
}

.alert.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

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

.alert.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.alert.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.progress-bar-fill.orange {
  background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
}

.progress-bar-fill.red {
  background: linear-gradient(90deg, var(--accent-red), #f87171);
}

.progress-bar-fill.blue {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
}

.progress-bar-fill.purple {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.pagination-buttons button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pagination-buttons button:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.pagination-buttons button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ---------- Marketplace badges in table ---------- */
.mp-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ---------- Sync Status ---------- */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.sync-dot.synced {
  background: var(--accent-green);
}

.sync-dot.syncing {
  background: var(--accent-blue);
}

.sync-dot.error {
  background: var(--accent-red);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ---------- Tool Cards ---------- */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
}

.tool-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.tool-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.settings-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.settings-row-info {
  flex: 1;
}

.settings-row-info h5 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.settings-row-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle {
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.toggle.active {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: all var(--transition-fast);
}

.toggle.active::after {
  left: 22px;
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
}

/* ---------- Inventory Category ---------- */
.inv-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.inv-category-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.inv-category-header .count {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Cost Calculator ---------- */
.calc-result {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}

.calc-result .big-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-green);
  margin: 8px 0;
}

/* ---------- Tooltip ---------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 50;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.slide-in {
  animation: slideIn 0.3s ease forwards;
}

/* Stagger animation */
.stagger>* {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.stagger>*:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger>*:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
  animation-delay: 0.2s;
}

.stagger>*:nth-child(5) {
  animation-delay: 0.25s;
}

.stagger>*:nth-child(6) {
  animation-delay: 0.3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {

  .grid-2-1,
  .grid-1-1,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 200;
  }

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

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

  .main-content {
    margin-left: 0 !important;
    padding: 16px;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-box {
    width: 100%;
  }

  .tabs {
    padding: 0 12px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 24px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 12px 16px;
  }
}

/* ---------- Utility Classes ---------- */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

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

.text-green {
  color: var(--accent-green);
}

.text-red {
  color: var(--accent-red);
}

.text-orange {
  color: var(--accent-orange);
}

.text-blue {
  color: var(--accent-blue);
}

.text-purple {
  color: var(--primary-light);
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.mt-4 {
  margin-top: 4px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mr-8 {
  margin-right: 8px;
}

.gap-8 {
  gap: 8px;
}

.gap-16 {
  gap: 16px;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-1 {
  flex: 1;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

/* ---------- Notifications & Toasts ---------- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  width: 320px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex;
  gap: 12px;
  pointer-events: auto;
  animation: toast-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.toast.success::before {
  background: var(--accent-green);
}

.toast.danger::before {
  background: var(--accent-red);
}

.toast.info::before {
  background: var(--accent-blue);
}

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

.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.toast.danger .toast-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.toast.info .toast-icon {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: block;
}

.toast-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin-top: -4px;
  margin-right: -4px;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.fade-out {
  transform: translateX(100%);
  opacity: 0;
}