/* ==========================================================================
   junaspin PIM v3.0.0 CSS Design System (Premium Slate/Violet Dark Theme)
   ========================================================================== */

/* Color Variables & Design Tokens */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Color Palette - HSL values for color flexibility */
  --bg-app: hsl(225, 25%, 8%);
  --bg-sidebar: hsl(225, 28%, 6%);
  --bg-card: hsl(225, 20%, 12%);
  --bg-card-hover: hsl(225, 20%, 16%);
  --border-color: hsl(225, 16%, 18%);
  --border-focus: hsl(263, 90%, 65%);

  --color-text-primary: hsl(220, 20%, 94%);
  --color-text-muted: hsl(220, 10%, 65%);
  --color-text-dark: hsl(220, 20%, 40%);

  /* Accent Colors */
  --accent-primary: hsl(263, 90%, 60%);
  --accent-primary-glow: hsla(263, 90%, 60%, 0.15);
  --accent-success: hsl(150, 84%, 38%);
  --accent-success-bg: hsla(150, 84%, 38%, 0.1);
  --accent-danger: hsl(350, 84%, 55%);
  --accent-danger-bg: hsla(350, 84%, 55%, 0.1);
  --accent-warning: hsl(40, 95%, 50%);
  --accent-warning-bg: hsla(40, 95%, 50%, 0.1);
  --accent-info: hsl(200, 95%, 45%);
  
  /* Shadow & Transitions */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-dark);
}

/* App Container & Sidebar Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary), hsl(280, 90%, 55%));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

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

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-version {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
}

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

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.menu-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.menu-item:hover {
  color: #fff;
  background-color: var(--bg-card);
}

.menu-item.active {
  color: #fff;
  background-color: var(--accent-primary-glow);
  border-left: 3px solid var(--accent-primary);
  font-weight: 600;
}

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

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--accent-danger);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.logout-btn:hover {
  background-color: var(--accent-danger-bg);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content.full-width {
  margin-left: 0;
}

/* Top Navbar */
.top-nav {
  height: 70px;
  background-color: rgba(13, 15, 23, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Content Wrapper */
.content-wrapper {
  padding: 32px;
  flex: 1;
}

/* ==========================================================================
   UI Components (Alerts, Buttons, Forms, Cards)
   ========================================================================== */

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-icon {
  font-size: 20px;
}

.alert-body h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-body p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.alert-danger {
  background-color: var(--accent-danger-bg);
  border: 1px solid hsla(350, 84%, 55%, 0.2);
  color: hsl(350, 100%, 75%);
}

.alert-warning {
  background-color: var(--accent-warning-bg);
  border: 1px solid hsla(40, 95%, 50%, 0.2);
  color: hsl(40, 100%, 70%);
}

.alert-warning .alert-icon {
  color: var(--accent-warning);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(13, 15, 23, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
  background-color: rgba(13, 15, 23, 0.8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-gradient: linear-gradient(135deg, var(--accent-primary), hsl(263, 90%, 50%));
  background-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Pages Style (Login, Dashboard)
   ========================================================================== */

/* Login Page (Glassmorphism & Center Alignment) */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  font-size: 44px;
  background: linear-gradient(135deg, var(--accent-primary), hsl(280, 90%, 55%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.2));
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--color-text-muted);
  font-size: 14px;
}

.login-footer {
  margin-top: 32px;
  text-align: center;
}

.login-footer p {
  font-size: 11px;
  color: var(--color-text-dark);
}

/* Dashboard Statistics Grid */
.dashboard-wrapper {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

#stat-products::after { background-color: var(--accent-primary); }
#stat-suppliers::after { background-color: var(--accent-info); }
#stat-imports::after { background-color: var(--accent-success); }

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-products {
  background-color: var(--accent-primary-glow);
  color: var(--accent-primary);
}

.icon-suppliers {
  background-color: rgba(14, 165, 233, 0.15);
  color: hsl(199, 89%, 48%);
}

.icon-imports {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
}

.stat-details h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.stat-indicator {
  position: absolute;
  right: 24px;
  bottom: 24px;
}

.stat-indicator .label {
  font-size: 11px;
  color: var(--color-text-dark);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Split Grid (Quick Actions & Tables) */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 350px 1fr;
  }
}

.dashboard-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

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

.panel-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.badge {
  background-color: var(--border-color);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
}

.panel-body {
  padding: 24px;
  flex: 1;
}

/* Action Cards */
.action-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: rgba(13, 15, 23, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.action-card i {
  font-size: 18px;
  color: var(--accent-primary);
}

.action-card:hover {
  background-color: var(--accent-primary-glow);
  border-color: var(--accent-primary);
  transform: translateX(4px);
}

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

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

.data-table th {
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--color-text-primary);
}

.data-table tbody tr:hover {
  background-color: rgba(139, 92, 246, 0.02);
}

.supplier-tag {
  background-color: var(--border-color);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}

.file-name {
  font-family: monospace;
  color: var(--color-text-muted);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.status-success {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
}

.status-pending {
  background-color: var(--accent-warning-bg);
  color: var(--accent-warning);
}

.status-failed {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--color-text-dark);
  text-align: center;
  gap: 12px;
}

.empty-state i {
  font-size: 40px;
}

.empty-state p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.text-right { text-align: right; }
.font-mono { font-family: monospace; }

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

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

/* ==========================================================================
   PIM Additional Layouts & Helper Classes
   ========================================================================== */

/* Helper utilities */
.d-none { display: none !important; }
.margin-bottom-0 { margin-bottom: 0 !important; }
.margin-bottom-6 { margin-bottom: 6px !important; }
.margin-bottom-20 { margin-bottom: 20px !important; }
.margin-bottom-24 { margin-bottom: 24px !important; }
.margin-bottom-32 { margin-bottom: 32px !important; }
.padding-bottom-20 { padding-bottom: 20px !important; }
.border-bottom-1 { border-bottom: 1px solid var(--border-color) !important; }
.gap-20 { gap: 20px !important; }
.gap-32 { gap: 32px !important; }
.flex-column { display: flex; flex-direction: column; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.inline-label { margin-bottom: 0 !important; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; font-weight: 500 !important; }
.font-bold { font-weight: 700; }
.text-accent { color: var(--accent-primary) !important; }
.text-success { color: var(--accent-success) !important; }
.text-danger { color: var(--accent-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* Todo Cards alert state styling */
.todo-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
}
.todo-card .todo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background-color: var(--border-color);
  color: var(--color-text-muted);
}
.todo-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.todo-card .todo-count {
  font-size: 12px;
  color: var(--color-text-muted);
}
.todo-card.has-items {
  border-color: hsla(350, 84%, 55%, 0.4);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}
.todo-card.has-items .todo-icon {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
}

/* Simulation Statistics UI */
.sim-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  background-color: rgba(13, 15, 23, 0.4);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.sim-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sim-stat .label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sim-stat .value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

/* Select element styling */
.input-select {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(13, 15, 23, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: all var(--transition-fast);
}
.input-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Catalog Explorer layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 280px 1fr;
  }
}
.catalog-facets-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  align-self: start;
}
.facets-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.facets-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.facets-header small {
  color: var(--accent-primary);
}
.facet-group {
  margin-bottom: 20px;
}
.facet-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.facet-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.facet-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text-primary);
}
.facet-checkbox {
  cursor: pointer;
}
.empty-facets-message {
  text-align: center;
  color: var(--color-text-dark);
  padding: 20px 0;
}
.empty-facets-message i {
  font-size: 28px;
  margin-bottom: 8px;
}

/* Detail view specific */
.item-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}
.spec-item {
  display: flex;
  flex-direction: column;
}
.spec-item .label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.spec-item .value {
  font-weight: 600;
  color: #fff;
}

/* Generic layout utilities */
.catalog-filters-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 24px;
}
.filter-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.filter-inputs .form-group {
  flex: 1 1 200px;
}
.filter-inputs input, .filter-inputs select {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(13, 15, 23, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
}

.d-none-facet {
  display: none !important;
}
