:root {
  --bg-body: #f4f6f8;
  --bg-card: #ffffff;
  --text-main: #333333;
  --text-muted: #64748b;
  --accent-primary: #1976d2; /* Exact blue from screenshot */
  --accent-hover: #1565c0;
  --border-color: #e2e8f0;
  --sidebar-width: 260px;
  --header-height: 60px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* TOP NAVBAR */
.top-navbar {
  height: var(--header-height);
  background-color: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.logo-subtext {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout-header {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-logout-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* APP LAYOUT */
.app-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.sidebar-link i {
  color: #94a3b8;
  width: 20px;
  height: 20px;
}

.sidebar-link:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.sidebar-link:hover i {
  color: var(--accent-primary);
}

.sidebar-link.active {
  background: #eef2ff; /* Light blue tint from screenshot */
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

.sidebar-link.active i {
  color: var(--accent-primary);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  width: calc(100% - var(--sidebar-width));
}

/* Tabs */
.tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}

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

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

.dashboard-section {
  background: transparent;
}

.fancy-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Add Design Inline */
.add-design-wrapper {
  width: 100%;
}

.add-design-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .add-design-grid {
    grid-template-columns: 1fr;
  }
}

.image-preview-card {
  background: #e3f2fd; /* Light blue placeholder from their screenshot */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 250px;
}

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

.empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 500;
  gap: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Material Form Inputs */
.material-input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.material-input {
  width: 100%;
  padding: 0.75rem 0 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-main);
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.material-input:focus {
  border-bottom-color: var(--accent-primary);
  border-bottom-width: 2px;
}

.material-label {
  position: absolute;
  top: 0.75rem;
  left: 0;
  font-size: 0.95rem;
  color: #999;
  transition: all 0.2s ease;
  pointer-events: none;
}

.material-input:focus ~ .material-label,
.material-input:not(:placeholder-shown) ~ .material-label,
.material-label.active {
  top: -0.5rem;
  font-size: 0.75rem;
  color: var(--accent-primary);
}

textarea.material-input {
  resize: vertical;
  min-height: 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.4rem;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Lists */
.search-bar {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-bar:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  background: white;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.design-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f5f9;
}

.design-image-container {
  position: relative;
  width: 100%;
  height: 320px;
  background: #f8fafc;
}

.design-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent-primary);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 4px; /* More square like the screenshot */
  font-weight: 700;
  font-size: 0.85rem;
}

.design-info {
  padding: 1rem;
}

.design-sku {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #1e293b;
}

.design-platform {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  padding: 0 1rem 1rem 1rem;
  cursor: pointer;
  margin-top: auto;
}

.checkbox-wrapper input {
  margin-right: 0.5rem;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.completed-tag {
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

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

.modal-content {
  background: white;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

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

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

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
}

.btn-close:hover {
  background: #f1f5f9;
  color: #ef4444;
}

.platform-select-inline {
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--text-main);
  background: #f8fafc;
  cursor: pointer;
  margin-left: 0.25rem;
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  margin-top: 1rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper i {
  width: 28px;
  height: 28px;
}

.pending-icon {
  background-color: #fffbeb;
  color: #d97706;
}

.stat-card.pending-stat-card:hover {
  border-color: #f59e0b;
}

.completed-icon {
  background-color: #ecfdf5;
  color: #10b981;
}

.stat-card.completed-stat-card:hover {
  border-color: #10b981;
}

.stat-card.stockout-stat-card:hover {
  border-color: #ef4444;
}

.stat-card.stockin-stat-card:hover {
  border-color: #10b981;
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Login Screen Overlay */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 10% 20%, #f1f5f9 0%, #e2e8f0 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  overflow: hidden;
}

/* Glowing background patterns */
.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
  animation: pulse-glow 12s infinite alternate ease-in-out;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, rgba(168, 85, 247, 0.1) 100%);
  top: -15%;
  left: -10%;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, rgba(99, 102, 241, 0.1) 100%);
  bottom: -15%;
  right: -10%;
  animation-delay: -6s;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.2) translate(40px, 30px);
  }
}

.login-card {
  position: relative;
  z-index: 2; /* Over the glows */
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  width: 100%;
  max-width: 480px; /* Make it slightly wider to fit 4 columns beautifully */
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12), 0 15px 25px -20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* User Selection Avatar Grid */
.user-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.avatar-item:hover {
  transform: translateY(-2px);
}

.avatar-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  color: #64748b;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.avatar-circle i {
  width: 22px;
  height: 22px;
}

.avatar-label {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: #475569;
  text-align: center;
}

/* Active Highlight */
.avatar-item.active .avatar-circle {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.avatar-item.active .avatar-label {
  color: var(--accent-primary);
}

/* Custom User Role Colors for Avatars */
.admin-avatar { background-color: #e0f2fe; color: #0284c7; }
.avatar-item.active[data-username="vishal"] .avatar-circle,
.avatar-item.active[data-username="piyush"] .avatar-circle { border-color: #0284c7; background-color: #0284c7; color: white; }

.portal-avatar { background-color: #f3e8ff; color: #7c3aed; }
.avatar-item.active[data-username="portal"] .avatar-circle { border-color: #7c3aed; background-color: #7c3aed; color: white; }

.vendor-avatar { background-color: #e0f2fe; color: #0369a1; }
.avatar-item.active[data-username="vender"] .avatar-circle { border-color: #0369a1; background-color: #0369a1; color: white; }

.b2b-avatar { background-color: #ffedd5; color: #ea580c; }
.avatar-item.active[data-username="b2b"] .avatar-circle { border-color: #ea580c; background-color: #ea580c; color: white; }

.shop-avatar { background-color: #dcfce7; color: #16a34a; }
.avatar-item.active[data-username="shop"] .avatar-circle { border-color: #16a34a; background-color: #16a34a; color: white; }

.web-avatar { background-color: #e0f2fe; color: #2563eb; }
.avatar-item.active[data-username="website"] .avatar-circle { border-color: #2563eb; background-color: #2563eb; color: white; }

.bholo-avatar { background-color: #f1f5f9; color: #475569; }
.avatar-item.active[data-username="bholo"] .avatar-circle { border-color: #475569; background-color: #475569; color: white; }


/* User Permission Cards */
.user-permission-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.01);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.user-permission-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  border-color: #bae6fd;
}

.user-permission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 1rem;
}

.user-permission-username {
  font-weight: 800;
  font-size: 1.25rem;
  color: #1e293b;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-permission-username i {
  color: var(--accent-primary);
  background: #eff6ff;
  padding: 0.5rem;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .user-permission-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.permission-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.permission-col-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.5rem;
}

.permission-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Custom Pill Checkboxes for Permissions */
.permission-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  user-select: none;
}

.permission-checkbox-label:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.permission-checkbox-label input[type="checkbox"] {
  display: none; /* Hide default browser checkbox */
}

.permission-checkbox-label.active {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
}

.permission-checkbox-label.active::before {
  content: '✓';
  font-weight: 800;
  font-size: 0.85rem;
}
