/* ─── TechByte Admin — Apple-Inspired Light Theme ────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Backgrounds */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f5f5f7;
  --bg-sidebar: rgba(255, 255, 255, 0.72);
  --bg-hover: rgba(54, 176, 132, 0.06);

  /* Text */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --text-light: #aeaeb2;

  /* Brand */
  --accent: #36b084;
  --accent-hover: #2d9a72;
  --accent-light: rgba(54, 176, 132, 0.10);
  --accent-glow: rgba(54, 176, 132, 0.20);

  /* Borders & Shadows */
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

  /* Status */
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9f0a;
  --info: #007aff;

  /* Spacing & Sizing */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 100px;
  --sidebar-width: 260px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 0.3s;
}

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

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

/* Custom scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-primary);
}

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

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(54, 176, 132, 0.3);
  border-radius: 3px;
}

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

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #f5f5f7 100%);
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(54, 176, 132, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeInUp 0.6s var(--ease);
}

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

.login-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 6px;
  letter-spacing: -0.3px;
}

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

.logo-icon-lg {
  font-size: 44px;
  display: block;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--duration) var(--ease);
}

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

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

.logo-icon {
  font-size: 26px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  margin: 1px 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 450;
  transition: all var(--duration) var(--ease);
  border-radius: var(--radius-xs);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

.nav-divider {
  padding: 16px 24px 6px;
  margin: 0 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  font-weight: 600;
}

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

.admin-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.admin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-email {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-btn {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0;
  display: inline-block;
  font-weight: 500;
  transition: opacity var(--duration) var(--ease);
}

.logout-btn:hover {
  opacity: 0.7;
  color: var(--danger);
}

/* ─── Mobile Sidebar Toggle ─────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all var(--duration) var(--ease);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}

.sidebar-toggle:hover {
  box-shadow: var(--shadow-md);
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 36px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.admin-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.content-area {
  padding: 32px 36px;
  flex: 1;
  animation: fadeIn 0.4s var(--ease);
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow var(--duration) var(--ease);
}

.card:hover {
  box-shadow: var(--shadow);
}

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

.card-header h2,
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

/* ─── Stats Grid ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
}

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
  display: block;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

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

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
  background: var(--bg-primary);
}

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

.data-table tbody tr {
  transition: background var(--duration) var(--ease);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table code {
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
}

.no-img {
  font-size: 20px;
  opacity: 0.25;
}

.actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

.badge-pending {
  background: rgba(255, 159, 10, 0.12);
  color: var(--warning);
}

.badge-approved,
.badge-active,
.badge-fulfilled {
  background: rgba(52, 199, 89, 0.12);
  color: var(--success);
}

.badge-declined,
.badge-cancelled {
  background: rgba(255, 59, 48, 0.12);
  color: var(--danger);
}

.badge-draft {
  background: rgba(134, 134, 139, 0.12);
  color: var(--text-muted);
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.1px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 3px rgba(54, 176, 132, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  box-shadow: 0 4px 12px rgba(54, 176, 132, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 1px 3px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
  background: #e0342b;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.35);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 1px 3px rgba(52, 199, 89, 0.3);
}

.btn-success:hover {
  background: #2db84e;
  color: white;
}

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}

.btn-xs {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--duration) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-group select {
  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='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4px 24px;
}

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

.form-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 450;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.2px;
}

.section-title:first-child {
  margin-top: 0;
}

/* ─── Search & Inline Forms ──────────────────────────────────────────────── */
.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 14px;
  min-width: 260px;
  font-family: inherit;
  transition: all var(--duration) var(--ease);
}

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

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: white;
}

.filter-select {
  padding: 10px 36px 10px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  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='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.input-sm {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  width: 160px;
  transition: all var(--duration) var(--ease);
}

.input-sm:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.input-file,
.input-file-sm {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Flash Bar ──────────────────────────────────────────────────────────── */
.flash-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.flash-bar-success {
  background: rgba(52, 199, 89, 0.08);
  color: #248a3d;
  border-bottom-color: rgba(52, 199, 89, 0.15);
}
.flash-bar-error {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  border-bottom-color: rgba(255, 59, 48, 0.15);
}
.flash-bar button { color: inherit; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 450;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 40;
}

.alert-error {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

.alert-success {
  background: rgba(52, 199, 89, 0.08);
  color: var(--success);
  border: 1px solid rgba(52, 199, 89, 0.15);
}

/* ─── Detail View ────────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  margin-top: 24px;
  justify-content: center;
}

.page-btn {
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
  font-family: inherit;
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(54, 176, 132, 0.3);
}

/* ─── Text Utilities ─────────────────────────────────────────────────────── */
.text-success {
  color: var(--success);
  font-weight: 500;
}

.text-danger {
  color: var(--danger);
  font-weight: 500;
}

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

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 450;
}

/* ─── Brands Grid ────────────────────────────────────────────────────────── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.brand-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
}

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

.brand-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.brand-logo-lg {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  margin-right: 12px;
}

.brand-placeholder {
  width: 80px;
  height: 80px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

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

.brand-card h3 a {
  color: var(--text-primary);
}

.brand-card h3 a:hover {
  color: var(--accent);
}

.brand-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* ─── Discounts ──────────────────────────────────────────────────────────── */
.discount-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease);
}

.discount-card:hover {
  box-shadow: var(--shadow);
}

.discount-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.discount-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.discount-actions {
  display: flex;
  gap: 6px;
}

.discount-assign {
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.assigned-customers {
  margin-top: 14px;
  padding: 14px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.assigned-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

/* ─── Analytics ──────────────────────────────────────────────────────────── */
.breakdown-grid {
  display: grid;
  gap: 0;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.breakdown-item.total {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  border-bottom: none;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px solid var(--accent-light);
}

.breakdown-label {
  color: var(--text-secondary);
}

.breakdown-value {
  font-weight: 600;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 350px;
}

.progress-bar {
  width: 100px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}

/* ─── Image Preview ──────────────────────────────────────────────────────── */
.current-image {
  margin-top: 12px;
}

.preview-img {
  max-width: 120px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.image-preview img {
  max-width: 120px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ─── Email Editor ───────────────────────────────────────────────────────── */
.code-editor {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
  resize: vertical;
  min-height: 300px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

.email-preview {
  background: #fff;
  border-radius: var(--radius-sm);
  min-height: 200px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s var(--ease);
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 36px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: fadeInUp 0.3s var(--ease);
}

.modal-content h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.form-textarea {
  width: 100%;
  padding: 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: all var(--duration) var(--ease);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ─── Error Page ─────────────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 80px 24px;
}

.error-page h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 16px;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

/* ─── File Upload ────────────────────────────────────────────────────────── */
.file-upload-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.file-upload-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.file-upload-btn.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

.file-name {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-clear-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 50%;
  transition: background var(--duration) var(--ease);
}

.file-clear-btn:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* ─── Image Drop Zone ────────────────────────────────────────────────────── */
.image-drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
  cursor: default;
}

.image-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0, 122, 255, 0.05);
}

.drop-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ─── Bulk Actions ───────────────────────────────────────────────────────── */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  animation: fadeInUp 0.3s var(--ease);
}

.bulk-actions span {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ─── Search & Filter Bar ────────────────────────────────────────────────── */
.search-and-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 350px;
}

.search-form .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-form .search-input {
  padding-left: 38px;
  width: 100%;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.page-info {
  margin-left: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

/* ─── Product Row Clickable ──────────────────────────────────────────────── */
.product-row:hover {
  background: var(--bg-hover);
}

.product-row td {
  transition: background var(--duration) var(--ease);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar-toggle {
    display: flex;
  }

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

  .topbar {
    padding: 20px 24px 20px 70px;
  }

  .content-area {
    padding: 24px;
  }
}

/* ─── Customer Drawer ────────────────────────────────────────────────────── */
.customer-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease);
}

.customer-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}


.customer-row {
  transition: background-color 0.2s ease;
}

.customer-row:hover {
  background-color: rgba(67, 97, 238, 0.05) !important;
}

.customer-drawer {
  position: fixed;
  top: 0;
  right: -90%;
  width: 90%;
  max-width: 1200px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 2001;
  overflow-y: auto;
  transition: right 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  padding: 0;
}

.customer-drawer.open {
  right: 0;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-secondary);
  padding: 24px 36px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
}

.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--accent);
  transform: rotate(90deg);
}

.drawer-content {
  padding: 36px;
}

@media (max-width: 768px) {
  .customer-drawer {
    width: 100%;
  }

  .drawer-header {
    padding: 16px 24px;
  }

  .drawer-content {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .brands-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

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

  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    padding: 16px 16px 16px 60px;
  }

  .content-area {
    padding: 16px;
  }

  .page-title {
    font-size: 20px;
  }

  .search-input {
    min-width: auto;
    width: 100%;
  }
}

/* ─── Product Form Layout ────────────────────────────────────────────────── */
.pf-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.pf-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pf-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

/* ─── Product Form Panel ─────────────────────────────────────────────────── */
.pf-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.pf-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.pf-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0;
}

.pf-panel-body {
  padding: 20px;
}

.pf-panel-body .form-group:last-child {
  margin-bottom: 0;
}

/* ─── Two-column row inside a panel ─────────────────────────────────────── */
.pf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pf-row .form-group {
  margin-bottom: 0;
}

/* ─── Input variants ─────────────────────────────────────────────────────── */
.input-lg {
  font-size: 16px !important;
  font-weight: 500 !important;
  padding: 13px 16px !important;
}

.input-mono {
  font-family: 'SF Mono', 'Fira Code', monospace !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
}

/* ─── Input + action button row ──────────────────────────────────────────── */
.input-action-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-action-row select,
.input-action-row input {
  flex: 1;
  min-width: 0;
}

.ia-btn {
  padding: 0 12px !important;
  height: 42px;
  font-size: 18px !important;
  flex-shrink: 0;
  line-height: 1;
}

/* ─── Label helpers ──────────────────────────────────────────────────────── */
.req {
  color: var(--danger);
  margin-left: 2px;
  font-weight: 600;
}

.label-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  margin-left: 4px;
}

/* ─── Field hint / SKU feedback ──────────────────────────────────────────── */
.field-hint {
  font-size: 12px;
  margin-top: 5px;
  min-height: 16px;
  color: var(--text-muted);
}

.hint-error   { color: var(--danger) !important; }
.hint-success { color: var(--success) !important; }
.hint-info    { color: var(--info) !important; }

/* ─── Tag chips (new product form) ──────────────────────────────────────── */
.tag-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--duration) var(--ease);
}

.tag-chip-remove:hover { opacity: 1; }

.tag-chip-empty {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}

/* ─── Tag chips (static / edit view) ────────────────────────────────────── */
.tag-chip-static {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
}

.tag-chip-static .remove-tag-btn {
  background: none;
  border: none;
  color: #92400e;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  line-height: 1;
}

/* ─── Image remove button ────────────────────────────────────────────────── */
.img-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

/* ─── Product Form Actions bar ───────────────────────────────────────────── */
.pf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.pf-actions-left,
.pf-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── Responsive product form ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pf-layout {
    grid-template-columns: 1fr;
  }

  .pf-sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .pf-row {
    grid-template-columns: 1fr;
  }

  .pf-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .pf-actions-left,
  .pf-actions-right {
    justify-content: center;
    flex-wrap: wrap;
  }
}