/* ============================================
   Racingbros Dealer System - Design System
   ============================================ */

/* CSS Variables */
:root {
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-primary-light: #ef4444;
  --color-accent: #10b981;
  --color-accent-dark: #059669;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-sidebar: #1c1d22;
  --color-sidebar-hover: #2a2b32;
  --color-sidebar-active: #dc2626;
  --color-sidebar-text: #868e96;
  --color-sidebar-text-active: #ffffff;
  --color-bg: #18191d;
  --color-bg-white: #25262b;
  --color-border: #383a42;
  --color-text: #c9cdd4;
  --color-text-muted: #868e96;
  --color-text-light: #5c5f66;
  --sidebar-width: 240px;
  --navbar-height: 60px;
  --radius: 5px;
  --radius-lg: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.6), 0 4px 6px -2px rgba(0,0,0,0.5);
  --transition: all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

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

/* App Layout (column: header on top, content below) */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* ============================================
   App Header (two-row top nav)
   ============================================ */

.app-header {
  background: var(--color-sidebar);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Row 1: Logo + User */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 54px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.header-logo-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
}

.header-site-label {
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}

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

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 6px 12px;
}

.header-search i { color: var(--color-text-muted); font-size: 12px; }

.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--color-text);
  width: 160px;
  font-size: 13px;
}

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

.header-cart-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.header-cart-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.header-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
}

.header-dealer-no {
  color: var(--color-text-muted);
  font-size: 12px;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.header-username {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
}

.header-level-badge {
  background: rgba(220,38,38,0.75);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
}

.header-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.header-logout-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Row 2: Nav Tabs + Page Title */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 42px;
  background: #13141a;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
}

.header-nav-tabs::-webkit-scrollbar { display: none; }

.header-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  padding-left: 16px;
}

/* Page Actions bar (replaces page-header for action buttons) */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.header-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: relative;
}

.header-nav-item i { font-size: 11px; }

.header-nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.header-nav-item.active {
  color: #fff;
  background: var(--color-primary);
}

.header-nav-badge {
  position: absolute;
  top: 1px;
  right: 3px;
  background: #fff;
  color: var(--color-primary);
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

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

.sidebar-logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-logo-sub {
  color: var(--color-sidebar-text);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-user {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-level {
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav-section {
  margin-bottom: 4px;
}

.sidebar-nav-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-sidebar-text);
  opacity: 0.6;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--color-sidebar-text);
  cursor: pointer;
  transition: var(--transition);
  border-radius: 4px;
  margin: 1px 8px;
  font-size: 13px;
  position: relative;
}

.sidebar-nav-item:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
}

.sidebar-nav-item.active {
  background: var(--color-primary);
  color: #fff;
}

.sidebar-nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--color-sidebar-text);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  transition: var(--transition);
  width: 100%;
}

.sidebar-logout:hover {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

/* ============================================
   Navbar
   ============================================ */

.navbar-left { display: flex; align-items: center; gap: 16px; }
.navbar-right { display: flex; align-items: center; gap: 12px; }

.navbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.navbar-search {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 6px 12px;
  gap: 8px;
  width: 240px;
}

.navbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--color-text);
}

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

.navbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.navbar-icon-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.navbar-cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.navbar-user:hover { background: var(--color-bg); }

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

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

.navbar-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #25262b;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 4px;
  z-index: 200;
  margin-top: 4px;
}

.navbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
  color: var(--color-text);
  transition: var(--transition);
}

.navbar-dropdown-item:hover { background: var(--color-bg); }
.navbar-dropdown-item.danger { color: var(--color-danger); }
.navbar-dropdown-item.danger:hover { background: rgba(239,68,68,0.12); }
.navbar-dropdown-divider { height: 1px; background: var(--color-border); margin: 4px 0; }

/* ============================================
   Cards & Panels
   ============================================ */

.card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

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

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

.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  background: #1e1f25;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat Cards */
.stat-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-card-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.stat-card-icon.blue,
.stat-card-icon.green,
.stat-card-icon.orange,
.stat-card-icon.red,
.stat-card-icon.purple { background: rgba(255,255,255,0.06); color: var(--color-text-muted); }

.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

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

/* ============================================
   Product Cards
   ============================================ */

.product-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.product-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: #2e2f36;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 36px;
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.product-stock-badge.in-stock { background: rgba(100,116,139,0.6); color: #fff; }
.product-stock-badge.low-stock { background: rgba(100,116,139,0.6); color: #fff; }
.product-stock-badge.out-of-stock { background: rgba(239,68,68,0.75); color: #fff; }

.product-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }

.product-card-brand {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.product-card-sku {
  font-size: 11px;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.product-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.product-card-tag {
  background: #2e2f36;
  color: var(--color-text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 2px;
}

.product-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.product-price-list {
  font-size: 12px;
  color: var(--color-text-light);
  text-decoration: line-through;
}

/* ============================================
   Product List Row
   ============================================ */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.product-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--color-bg-white);
  transition: background 0.15s ease;
  cursor: default;
}

.product-row:hover { background: #2e2f36; }

/* Thumbnail */
.product-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: #2e2f36;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 20px;
}

.product-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info */
.product-row-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.product-row-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.product-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.product-row-name:hover { text-decoration: underline; }

.product-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.product-row-sku {
  font-size: 12px;
  color: var(--color-text-light);
}

/* Stock column */
.product-row-stock {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.product-row-stock .product-stock-badge {
  font-size: 12px;
  padding: 3px 8px;
}

/* Price column */
.product-row-price {
  flex-shrink: 0;
  text-align: right;
  width: 110px;
}

/* Action column */
.product-row-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Filter Panel
   ============================================ */

.filter-panel {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filter-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}

.filter-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.filter-section:last-child { border-bottom: none; }

.filter-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.filter-option:hover { color: var(--color-primary); }
.filter-option input[type="checkbox"] { accent-color: var(--color-primary); }
.filter-option input[type="radio"] { accent-color: var(--color-primary); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-success {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-success:hover:not(:disabled) {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: 4px; }
.btn-block { width: 100%; }

/* ============================================
   Forms
   ============================================ */

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

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

.form-label.required::after {
  content: ' *';
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-text);
  background: #2e2f36;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.form-control::placeholder { color: var(--color-text-light); }
.form-control:disabled { background: var(--color-bg); cursor: not-allowed; }

.form-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--color-danger);
  margin-top: 4px;
}

select.form-control { cursor: pointer; }

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

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 10px 14px;
  background: #1e1f25;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.04); }

/* ============================================
   Badges & Status
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: rgba(220,38,38,0.75); color: #fff; }
.badge-success { background: rgba(16,185,129,0.75); color: #fff; }
.badge-warning { background: rgba(245,158,11,0.75); color: #fff; }
.badge-danger { background: rgba(239,68,68,0.75); color: #fff; }
.badge-gray { background: rgba(255,255,255,0.18); color: #fff; }
.badge-purple { background: rgba(124,58,237,0.75); color: #fff; }

/* Order Status Badges */
.status-pending { background: rgba(255,255,255,0.10); color: #9ca3af; }
.status-processing { background: rgba(255,255,255,0.10); color: #9ca3af; }
.status-shipped { background: rgba(16,185,129,0.75); color: #fff; }
.status-delivered { background: rgba(16,185,129,0.9); color: #fff; }
.status-cancelled { background: rgba(239,68,68,0.75); color: #fff; }

/* ============================================
   Page Layout Helpers
   ============================================ */

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-8 { grid-template-columns: repeat(8, 1fr); }
.grid-product { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-20 { gap: 20px; }
.grid-24 { gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.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-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.p-0 { padding: 0 !important; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-accent); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ============================================
   Products Page Layout
   ============================================ */

.products-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.products-filter-sticky {
  position: sticky;
  top: 0;
  align-self: start;
}

.products-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.products-count {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-left: auto;
}

/* ============================================
   Cart
   ============================================ */

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: 5px;
  background: #2e2f36;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 13px; }
.cart-item-sku { font-size: 11px; color: var(--color-text-light); margin-top: 2px; }
.cart-item-price { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2e2f36;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-muted);
  transition: var(--transition);
}

.qty-btn:hover { background: var(--color-bg); color: var(--color-primary); }

.qty-input {
  width: 48px;
  height: 30px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  background: #25262b;
  color: var(--color-text);
}

.cart-subtotal { font-weight: 700; font-size: 15px; color: var(--color-primary); min-width: 80px; text-align: right; }

/* Cart summary */
.cart-summary {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--navbar-height) + 24px);
}

.cart-summary-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.cart-summary-row:last-child { border-bottom: none; }
.cart-summary-total { font-size: 18px; font-weight: 700; color: var(--color-primary); }

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

body.no-scroll { overflow: hidden; }

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

.modal {
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-lg { max-width: 820px; }

/* Modal transition */
.modal-fade-enter-active, .modal-fade-leave-active { transition: opacity 0.18s ease; }
.modal-fade-enter-from, .modal-fade-leave-to { opacity: 0; }

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

.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border-radius: 2px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--color-text-muted); font-size: 18px; transition: var(--transition); }
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 8px; background: #1e1f25; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ============================================
   Pagination
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-white);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--color-text-muted);
}

.page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   Login Page
   ============================================ */

.login-page {
  min-height: 100vh;
  background-color: #000;
  background-image: url('/assets/images/SCOUT43_EMOTO_16.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: auto 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg-pattern {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(45,45,45,0.75) 0%, rgba(26,26,26,0.8) 40%, rgba(0,0,0,0.88) 100%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 28px 28px 24px;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo-main {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
}

.login-logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-form-group { margin-bottom: 12px; }

.login-field {
  position: relative;
}

.login-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
  transition: all 0.18s ease;
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}

.login-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.login-input::placeholder { color: transparent; }

.login-input:focus,
.login-input:not(:placeholder-shown) {
  padding-top: 18px;
  padding-bottom: 4px;
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
}

.login-input:focus ~ .login-label,
.login-input:not(:placeholder-shown) ~ .login-label {
  top: 6px;
  transform: none;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.login-input:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}

.login-btn {
  width: 100%;
  padding: 11px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.login-btn:hover { background: #b91c1c; }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.login-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 10px;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.empty-state-text { font-size: 13px; }

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
  gap: 0;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}

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

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.alert-warning { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.alert-danger { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.alert-info { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }

/* ============================================
   Misc
   ============================================ */

.divider { height: 1px; background: var(--color-border); margin: 16px 0; }

.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #2e2f36;
  border-radius: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Transitions */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.slide-enter-active, .slide-leave-active { transition: all 0.25s ease; }
.slide-enter-from { transform: translateX(-10px); opacity: 0; }
.slide-leave-to { transform: translateX(10px); opacity: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4a4b52; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #5c5f66; }

/* ============================================
   Admin Light Theme（僅 body.admin-page）
   參考 Salesforce 風格：暖米色背景 + 純白卡片 + 暖色邊框
   header-top / header-nav 保持原灰色不變
   app-content 改為暖白底配色
   ============================================ */

body.admin-page .app-content {
  --color-bg:          #f2f1ee;
  --color-bg-white:    #ffffff;
  --color-border:      #e5e2db;
  --color-text:        #181818;
  --color-text-muted:  #6b6b6b;
  --color-text-light:  #9a9a9a;
  --shadow:            0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:         0 4px 8px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.05);
  --shadow-lg:         0 10px 20px -3px rgba(0,0,0,0.10), 0 4px 8px -2px rgba(0,0,0,0.06);
  background: #f2f1ee;
  color: #181818;
}

/* 覆寫 hardcode 深色背景 */
body.admin-page .app-content .card-footer           { background: #f8f7f4; }
body.admin-page .app-content .card                  { border-color: #e5e2db; }
body.admin-page .app-content .table th              { background: #f5f3ef; color: #5a5a5a; border-bottom: 1px solid #e5e2db; }
body.admin-page .app-content .table td              { border-bottom-color: #eeece8; }
body.admin-page .app-content .table tr:hover td     { background: rgba(0,0,0,0.03); }
body.admin-page .app-content .table-wrapper         { border-color: #e5e2db; }
body.admin-page .app-content .form-control          { background: #ffffff; border-color: #d8d5ce; color: #181818; }
body.admin-page .app-content .form-control:focus    { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.10); }
body.admin-page .app-content .form-control::placeholder { color: #b0aba2; }
body.admin-page .app-content .form-control:disabled { background: #f5f3ef; }
body.admin-page .app-content .products-toolbar      { background: #ffffff; border-color: #e5e2db; }
body.admin-page .app-content .filter-panel          { background: #ffffff; border-color: #e5e2db; }
body.admin-page .app-content .page-btn              { background: #ffffff; border-color: #e5e2db; color: #6b6b6b; }
body.admin-page .app-content .page-btn:hover        { border-color: var(--color-primary); color: var(--color-primary); }
body.admin-page .app-content .page-btn.active       { background: #ffffff; border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }
body.admin-page .app-content .btn-ghost             { border-color: #d8d5ce; color: #6b6b6b; background: #ffffff; }
body.admin-page .app-content .btn-ghost:hover       { background: #f5f3ef; color: #181818; }
body.admin-page .app-content .qty-btn              { background: #f5f3ef; }
body.admin-page .app-content .qty-btn:hover        { background: #eeece8; }
body.admin-page .app-content .qty-input            { background: #ffffff; color: #181818; border-color: #d8d5ce; }
body.admin-page .app-content .tag                  { background: #eeece8; color: #6b6b6b; }
body.admin-page .app-content .tabs                 { border-bottom-color: #e5e2db; }
body.admin-page .app-content .divider              { background: #e5e2db; }
body.admin-page .app-content .product-card-image   { background: #eeece8; }
body.admin-page .app-content .product-card-tag     { background: #eeece8; color: #6b6b6b; }
body.admin-page .app-content .product-row          { background: #ffffff; }
body.admin-page .app-content .product-row:hover    { background: #f5f3ef; }
body.admin-page .app-content .product-row-thumb    { background: #eeece8; }
body.admin-page .app-content .product-list         { background: #e5e2db; border-color: #e5e2db; }

/* stat-card icon：暖色調彩色背景 */
body.admin-page .app-content .stat-card-icon.blue   { background: rgba(37,99,235,0.08);   color: #2563eb; }
body.admin-page .app-content .stat-card-icon.green  { background: rgba(16,185,129,0.08);  color: #10b981; }
body.admin-page .app-content .stat-card-icon.orange { background: rgba(245,158,11,0.08);  color: #d97706; }
body.admin-page .app-content .stat-card-icon.red    { background: rgba(220,38,38,0.08);   color: #dc2626; }
body.admin-page .app-content .stat-card-icon.purple { background: rgba(124,58,237,0.08);  color: #7c3aed; }

/* navbar-dropdown 在 admin 亮色主題下改為白色 */
body.admin-page .navbar-dropdown {
  background: #ffffff;
  border-color: #e5e2db;
  box-shadow: 0 8px 20px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}
body.admin-page .navbar-dropdown-item            { color: #181818; }
body.admin-page .navbar-dropdown-item:hover      { background: #f5f3ef; }
body.admin-page .navbar-dropdown-item.danger     { color: #dc2626; }
body.admin-page .navbar-dropdown-item.danger:hover { background: rgba(220,38,38,0.06); }
body.admin-page .navbar-dropdown-divider         { background: #e5e2db; }

/* modal 在 body 層，不在 app-content 內 */
body.admin-page .modal                { background: #ffffff; border-color: #e5e2db; }
body.admin-page .modal-header         { border-bottom-color: #e5e2db; }
body.admin-page .modal-footer         { background: #f8f7f4; border-top-color: #e5e2db; }
body.admin-page .modal-title          { color: #181818; }
body.admin-page .modal-close          { color: #9a9a9a; }
body.admin-page .modal-close:hover    { background: #f5f3ef; color: #181818; }
body.admin-page .modal .form-control  { background: #ffffff; border-color: #d8d5ce; color: #181818; }
body.admin-page .modal .form-label    { color: #181818; }
body.admin-page .modal .card-title    { color: #181818; }
body.admin-page .modal .text-muted    { color: #6b6b6b; }
body.admin-page .modal .divider       { background: #e5e2db; }
body.admin-page .modal .badge-gray    { background: rgba(0,0,0,0.08); color: #5a5a5a; }

/* alert 在 admin 亮色下調整 */
body.admin-page .app-content .alert-success { background: rgba(16,185,129,0.08);  color: #065f46; border-color: rgba(16,185,129,0.25); }
body.admin-page .app-content .alert-warning { background: rgba(245,158,11,0.08);  color: #78350f; border-color: rgba(245,158,11,0.25); }
body.admin-page .app-content .alert-danger  { background: rgba(239,68,68,0.08);   color: #7f1d1d; border-color: rgba(239,68,68,0.25); }
body.admin-page .app-content .alert-info    { background: rgba(59,130,246,0.08);  color: #1e3a5f; border-color: rgba(59,130,246,0.25); }

/* scrollbar in admin content */
body.admin-page .app-content ::-webkit-scrollbar-thumb       { background: #d0cdc6; }
body.admin-page .app-content ::-webkit-scrollbar-thumb:hover { background: #b8b5ae; }

/* ============================================
   ProductBulkEdit — 試算表式批量編輯
   ============================================ */

/* allow horizontal scroll in bulk edit */
body.admin-page .app-content.bulk-edit-mode { overflow-x: auto; }

.bulk-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--color-border, #e5e2db);
}
.bulk-toolbar-left  { display:flex; align-items:center; gap:6px; flex:1; flex-wrap:wrap; }
.bulk-toolbar-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }

.bulk-stats {
  font-size: 12px; color: var(--color-text-muted,#6b6b6b);
  margin-bottom: 8px; display:flex; align-items:center; gap:10px;
}
.bulk-dirty-badge {
  display:inline-flex; align-items:center; gap:5px;
  background:rgba(245,158,11,0.12); color:#b45309;
  border:1px solid rgba(245,158,11,0.35);
  padding:2px 10px; border-radius:20px; font-size:12px; font-weight:600;
}
.bulk-dirty-dot {
  width:7px; height:7px; border-radius:50%; background:#f59e0b;
  display:inline-block; flex-shrink:0;
}

.bulk-table-wrap {
  width:100%; overflow-x:auto;
  border:1px solid var(--color-border,#e5e2db);
  border-radius:6px; background:#fff;
}
.bulk-table {
  border-collapse: collapse; width: 100%; min-width: 900px;
  font-size: 12px; table-layout: fixed;
}
.bulk-table thead th {
  background:#f5f3ef; color:#5a5a5a; font-size:10px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.5px;
  padding:6px 5px; white-space:nowrap;
  border-bottom:2px solid #e5e2db; border-right:1px solid #eeece8;
  position:sticky; top:0; z-index:3; text-align:center;
}
.bulk-table tbody td {
  padding:1px 2px; border-bottom:1px solid #f0ede8;
  border-right:1px solid #f0ede8; vertical-align:middle;
}
.bulk-table tbody tr:hover td         { background:#f9f8f5; }
.bulk-table tbody tr.row-dirty td     { background:#fffbf0; }
.bulk-table tbody tr.row-dirty:hover td { background:#fff5d6; }

/* sticky first 2 columns */
.bulk-table .col-sticky-1 { position:sticky; left:0; z-index:2; background:inherit; }
.bulk-table .col-sticky-2 { position:sticky; left:36px; z-index:2; background:inherit; }
.bulk-table thead .col-sticky-1 { z-index:4; }
.bulk-table thead .col-sticky-2 { z-index:4; }
.bulk-table tbody tr.row-dirty .col-sticky-1,
.bulk-table tbody tr.row-dirty .col-sticky-2 { background:#fffbf0; }
.bulk-table tbody tr.row-dirty:hover .col-sticky-1,
.bulk-table tbody tr.row-dirty:hover .col-sticky-2 { background:#fff5d6; }
.bulk-table tbody tr:hover .col-sticky-1,
.bulk-table tbody tr:hover .col-sticky-2 { background:#f9f8f5; }

.bulk-table input[type="text"],
.bulk-table input[type="number"],
.bulk-table select {
  width:100%; height:26px; min-width:0;
  border:1px solid transparent; border-radius:2px;
  padding:1px 4px; font-size:12px;
  background:transparent; color:#181818; outline:none;
  transition:border-color 0.12s, background 0.12s;
}
.bulk-table input:focus,
.bulk-table select:focus {
  border-color:var(--color-primary,#dc2626);
  background:#fff;
  box-shadow:0 0 0 2px rgba(220,38,38,0.07);
}
/* column widths */
.bulk-table .w-36  { width:36px;  min-width:36px; }
.bulk-table .w-50  { width:50px;  min-width:50px; }
.bulk-table .w-55  { width:55px;  min-width:55px; }
.bulk-table .w-60  { width:60px;  min-width:60px; }
.bulk-table .w-70  { width:70px;  min-width:70px; }
.bulk-table .w-75  { width:75px;  min-width:75px; }
.bulk-table .w-90  { width:90px;  min-width:90px; }
.bulk-table .w-100 { width:100px; min-width:100px; }
.bulk-table .w-110 { width:110px; min-width:110px; }
.bulk-table .w-120 { width:120px; min-width:120px; }
.bulk-table .w-130 { width:130px; min-width:130px; max-width:130px; }
.bulk-table .w-220 { width:220px; min-width:220px; }
.bulk-table .w-240 { width:240px; min-width:240px; }

.bulk-table td.td-plain { font-size:11px; text-align:center; padding:3px 4px; white-space:nowrap; }
.bulk-table .sku-mono { font-family:monospace; font-size:11px; color:#4b5563; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:122px; }

.bulk-footer {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 0 0; margin-top:8px;
  border-top:1px solid var(--color-border,#e5e2db);
  font-size:12px; color:var(--color-text-muted,#6b6b6b);
}

.bulk-toast {
  position:fixed; bottom:24px; right:24px;
  padding:10px 20px; border-radius:6px;
  font-size:13px; font-weight:600; z-index:9999;
  box-shadow:0 4px 12px rgba(0,0,0,0.18);
  animation: toast-in 0.2s ease;
}
.bulk-toast.success { background:#065f46; color:#fff; }
.bulk-toast.error   { background:#7f1d1d; color:#fff; }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ============================================
   Admin Login Page — 暖白配色
   ============================================ */

body.admin-page .login-page {
  background-color: #000;
  background-image: url('/assets/images/SCOUT43_EMOTO_16.png');
}

body.admin-page .login-bg-pattern {
  background: linear-gradient(160deg, rgba(45,45,45,0.75) 0%, rgba(26,26,26,0.8) 40%, rgba(0,0,0,0.88) 100%);
}

body.admin-page .login-card {
  background: #ffffff;
  border: 1px solid #e5e2db;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  backdrop-filter: none;
  overflow: hidden;
  padding: 0;
  max-width: 360px;
}

/* logo 區塊：保持深色背景讓白色 logo 可見 */
body.admin-page .login-logo {
  background: #1c1d22;
  padding: 24px 28px 20px;
  margin: 0;
  border-bottom: 2px solid #dc2626;
}

body.admin-page .login-logo-sub {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  margin-top: 6px;
  letter-spacing: 1.5px;
}

/* 標題與表單區域 */
body.admin-page .login-title {
  color: #181818;
  font-size: 17px;
  font-weight: 700;
  padding: 22px 28px 2px;
  margin: 0;
}

body.admin-page .login-subtitle {
  color: #9a9a9a;
  font-size: 13px;
  padding: 0 28px 16px;
  margin: 0;
}

body.admin-page .login-form-group {
  padding: 0 28px;
  margin-bottom: 12px;
}

body.admin-page .login-field { position: relative; }

body.admin-page .login-label {
  color: #9a9a9a;
}

body.admin-page .login-input {
  background: #f8f7f4;
  border: 1px solid #d8d5ce;
  color: #181818;
  border-radius: 5px;
}

body.admin-page .login-input::placeholder { color: transparent; }

body.admin-page .login-input:focus,
body.admin-page .login-input:not(:placeholder-shown) {
  background: #ffffff;
  border-color: #b0ada6;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

body.admin-page .login-input:focus ~ .login-label,
body.admin-page .login-input:not(:placeholder-shown) ~ .login-label {
  color: #9a9a9a;
}

body.admin-page .login-error {
  margin: 0 28px 12px;
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.2);
  color: #991b1b;
  border-radius: 4px;
}

body.admin-page .login-btn {
  display: block;
  margin: 16px 28px 24px;
  width: calc(100% - 56px);
  background: #dc2626;
  border-radius: 5px;
  letter-spacing: 0.3px;
}

body.admin-page .login-btn:hover:not(:disabled) { background: #b91c1c; }

/* ============================================
   Admin Login Transition Overlay
   ============================================ */

.login-transition-overlay {
  position: fixed;
  inset: 0;
  background: #0d0e12;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: loginOverlayIn 0.3s ease forwards;
}

@keyframes loginOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.login-transition-logo {
  animation: loginLogoUp 0.4s ease 0.1s both;
}

@keyframes loginLogoUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-transition-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: loginRingSpin 0.75s linear infinite, loginRingIn 0.4s ease 0.2s both;
}

@keyframes loginRingSpin {
  to { transform: rotate(360deg); }
}

@keyframes loginRingIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.login-transition-text {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: loginRingIn 0.4s ease 0.3s both;
  margin-top: -16px;
}

/* ============================================
   Dashboard Category Nav
   ============================================ */

.dash-cat-nav {
  background: #25262b;
  border: 1px solid #383a42;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: stretch;
}
.dash-cat-nav::-webkit-scrollbar { height: 3px; }
.dash-cat-nav::-webkit-scrollbar-track { background: transparent; }
.dash-cat-nav::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 2px; }

.dash-cat-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #868e96;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  font-family: inherit;
}
.dash-cat-item i {
  font-size: 18px;
  transition: color 0.18s;
}
.dash-cat-item:hover {
  color: #dc2626;
  border-bottom-color: #dc2626;
  background: rgba(220,38,38,0.06);
}
.dash-cat-item + .dash-cat-item {
  border-left: 1px solid #383a42;
}

/* ============================================
   Responsive (basic)
   ============================================ */

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
  .products-layout { grid-template-columns: 200px 1fr; }
}

@media (max-width: 768px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-main { margin-left: 0; }
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }
  .app-content { padding: 16px; }
}
