/* =========================================
   Clean Minimal Admin Dashboard
   ========================================= */

:root {
  /* Clean Light Color Palette */
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-sidebar: #1a1d29;
  --bg-hover: #f1f3f5;

  /* Text Colors */
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-light: #adb5bd;
  --text-white: #ffffff;

  /* Accent Colors */
  --accent-primary: #4f46e5;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  /* Borders */
  --border-color: #e9ecef;
  --border-radius: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition: all 0.2s ease;
}

/* =========================================
   Reset & Base Styles
   ========================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   Main Layout
   ========================================= */

.dashboard-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* =========================================
   Sidebar
   ========================================= */

.sidebar {
  background: var(--bg-sidebar);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 32px;
  color: var(--text-white);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand span {
  font-weight: 700;
  font-size: 18px;
}

/* Navigation */
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  color: var(--text-light);
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.nav-item.active {
  background: var(--accent-primary);
  color: var(--text-white);
}

/* =========================================
   Content Area
   ========================================= */

.content {
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-primary);
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

#section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.actions {
  display: flex;
  gap: 12px;
}

/* =========================================
   Buttons
   ========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gradient {
  background: var(--accent-primary);
  color: white;
  border: none;
}

.btn-gradient:hover {
  background: #4338ca;
}

.btn-outline {
  border-color: var(--border-color);
  background: transparent;
}

.btn-outline:hover {
  background: var(--bg-hover);
}

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

/* =========================================
   Sections
   ========================================= */

.section {
  display: none;
}

.section.visible {
  display: block;
}

/* =========================================
   Stats Cards
   ========================================= */

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

.card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.stat-icon {
  font-size: 32px;
  margin-bottom: 16px;
  color: var(--accent-primary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =========================================
   Grid Layouts
   ========================================= */

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

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* =========================================
   Toolbar
   ========================================= */

.toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.toolbar input,
.toolbar select {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.toolbar input::placeholder {
  color: var(--text-light);
}

/* =========================================
   Product Grid
   ========================================= */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-hover);
}

.product-card .info {
  padding: 20px;
}

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

.product-card .meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
}

.product-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* =========================================
   Tables
   ========================================= */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--bg-hover);
}

th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

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

tr:hover {
  background: var(--bg-hover);
}

/* =========================================
   Modal
   ========================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

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

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}

/* =========================================
   Form Elements
   ========================================= */

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* =========================================
   Notifications
   ========================================= */

.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--accent-success);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.notification.error {
  background: var(--accent-danger);
}

.notification.warning {
  background: var(--accent-warning);
}

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

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

/* =========================================
   Particles Container
   ========================================= */

#particles-container {
  display: none;
  /* Disabled for clean design */
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 968px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

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

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

/* =========================================
   Login Container
   ========================================= */

.login-container {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 9999;
}

.login-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 420px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

.login-header {
  text-align: center;
  padding: 40px 32px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  opacity: 0.9;
}

.login-body {
  padding: 32px;
}

.login-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--accent-danger);
  color: var(--accent-danger);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 14px;
  margin-bottom: 20px;
  animation: shake 0.4s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group label i {
  margin-right: 6px;
  color: var(--accent-primary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.login-body .btn {
  margin-top: 8px;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
}