/* ============================================
   发卡平台 — Modern Minimal Design System
   简约 · 现代 · 响应式
   ============================================ */

:root {
  /* Brand */
  --accent: #ff6bab;
  --accent-hover: #e84393;
  --accent-soft: rgba(255, 107, 171, 0.12);
  --accent-ring: rgba(255, 107, 171, 0.22);
  --accent-deep: #d63384;

  /* Neutrals */
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --dark: #0f1115;
  --dark-2: #1a1d24;

  /* Semantic */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Typography */
  --ff: "Inter", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --ff-display: "Inter", "SF Pro Display", "PingFang SC", system-ui, -apple-system, sans-serif;
  --ff-mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.05), 0 1px 2px rgba(17, 24, 39, 0.03);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08), 0 2px 6px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 16px 48px rgba(17, 24, 39, 0.12), 0 4px 12px rgba(17, 24, 39, 0.06);
  --shadow-glow: 0 8px 32px rgba(255, 107, 171, 0.25);

  /* Spacing / layout */
  --nav-h: 52px;
  --sidebar-w: 232px;
  --container: 1120px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.15s var(--ease);
  --t: 0.22s var(--ease);

  /* Compat aliases (old Apple tokens) */
  --clr-primary: var(--accent);
  --clr-primary-focus: var(--accent-hover);
  --clr-primary-on-dark: #ff9ec8;
  --clr-ink: var(--ink);
  --clr-body: var(--ink);
  --clr-body-on-dark: #fff;
  --clr-body-muted: #ccc;
  --clr-ink-muted-80: var(--ink-2);
  --clr-ink-muted-48: var(--muted);
  --clr-divider-soft: var(--line-soft);
  --clr-hairline: var(--line);
  --clr-canvas: var(--surface);
  --clr-canvas-parchment: var(--bg);
  --clr-surface-pearl: var(--surface-2);
  --clr-surface-tile-1: var(--dark-2);
  --clr-surface-tile-2: #22262e;
  --clr-surface-black: var(--dark);
  --clr-on-primary: #fff;
  --clr-on-dark: #fff;
  --clr-danger: var(--danger);
  --clr-success: var(--success);
  --clr-warning: var(--warning);
  --ff-text: var(--ff);
  --rd-none: 0;
  --rd-xs: var(--r-xs);
  --rd-sm: var(--r-sm);
  --rd-md: var(--r-md);
  --rd-lg: var(--r-lg);
  --rd-pill: var(--r-pill);
  --rd-full: var(--r-pill);
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 80px;
  --shadow-product: var(--shadow-md);
  --transition-fast: all var(--t-fast);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* 禁用浏览器默认蓝色聚焦框 / 点击高亮 */
*:focus,
*:focus-visible,
*:focus-within {
  outline: none !important;
}
button,
a,
input,
select,
textarea,
summary,
[tabindex],
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus,
[tabindex]:focus,
[role="button"]:focus {
  outline: none !important;
  box-shadow: none;
}

body {
  font-family: var(--ff);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { list-style: none; }

/* ── Top bar ── */
.top-bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15, 17, 21, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-bar .brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
  opacity: 0.92;
}

.top-bar .nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-bar .nav-right a,
.top-bar .nav-right span {
  color: rgba(255, 255, 255, 0.62);
  transition: color var(--t-fast);
}
.top-bar .nav-right a:hover {
  color: #fff;
  text-decoration: none;
}
.top-bar .user-name {
  color: #fff;
  font-weight: 500;
  opacity: 0.92;
}

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: fixed;
  top: var(--nav-h); left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 95;
}

.menu-group { margin-bottom: 18px; }
.menu-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 6px 12px 8px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.sidebar-menu li a:hover {
  background: var(--line-soft);
  color: var(--ink);
  text-decoration: none;
}
.sidebar-menu li a.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.sidebar-menu li a .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}
.sidebar-menu li a.active .badge {
  background: rgba(255, 255, 255, 0.22);
}
.sidebar-menu i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px 48px;
  max-width: calc(100% - var(--sidebar-w));
  min-width: 0;
}

/* ── Page header ── */
.page-header { margin-bottom: 24px; }
.page-title {
  font-family: var(--ff-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 107, 171, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-deep) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(255, 107, 171, 0.36);
}

.btn-secondary,
.btn-outline {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-secondary:hover,
.btn-outline:hover {
  background: var(--line-soft);
  color: var(--ink);
  border-color: #d1d5db;
  text-decoration: none;
}

.btn-outline-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #fecaca;
}
.btn-outline-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  text-decoration: none;
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--line-soft);
  color: var(--ink);
  text-decoration: none;
}

.btn-dark-utility {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 12.5px;
}
.btn-dark-utility:hover {
  background: #1f2937;
  color: #fff;
  text-decoration: none;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; text-align: center; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 14px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.card-title {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.form-control:hover { border-color: #d1d5db; }
.form-control:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
  background: #fff;
}
.form-control::placeholder { color: var(--muted-2); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%239ca3af' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.search-input-wrap { max-width: 320px; }
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: none;
}
.search-input::placeholder { color: var(--muted-2); }

/* ── Tables ── */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 560px;
}
table th {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table th:first-child { border-radius: var(--r-sm) 0 0 0; }
table th:last-child { border-radius: 0 var(--r-sm) 0 0; }
table td {
  font-size: 13.5px;
  color: var(--ink);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(246, 247, 251, 0.8); }

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  opacity: 0.85;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
  font-family: var(--ff-display);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-bg); color: #059669; }
.badge-warning { background: var(--warning-bg); color: #d97706; }
.badge-danger { background: var(--danger-bg); color: #dc2626; }
.badge-info { background: var(--accent-soft); color: var(--accent-deep); }
.badge-default { background: var(--line-soft); color: var(--muted); }

/* ── Alerts ── */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: #047857; border-color: #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: var(--warning-bg); color: #b45309; border-color: #fde68a; }
.alert-info { background: var(--info-bg); color: #1d4ed8; border-color: #bfdbfe; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}
.pagination a,
.pagination .page-current,
.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 560;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: all var(--t-fast);
  text-decoration: none;
}
.pagination a:hover,
.pagination .page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.pagination .page-current {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 107, 171, 0.28);
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }
.page-ellipsis { color: var(--muted); font-size: 12px; padding: 0 2px; }
.pagination-wrap { display: flex; justify-content: center; margin: 24px 0 12px; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.48);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-content,
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 22px;
  max-width: 460px;
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: modalIn 0.22s var(--ease);
}
.modal-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes modalOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(6px) scale(0.97); }
}

/* ── Public pages ── */
.public-page { min-height: 100vh; background: var(--bg); }
.public-tile-light {
  background: var(--surface);
  color: var(--ink);
  padding: var(--sp-section) 20px;
  text-align: center;
}
.public-tile-dark {
  background: var(--dark-2);
  color: #fff;
  padding: var(--sp-section) 20px;
  text-align: center;
}
.public-tile-parchment {
  background: var(--bg);
  color: var(--ink);
  padding: var(--sp-section) 20px;
  text-align: center;
}

.public-nav {
  background: rgba(15, 17, 21, 0.88);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.public-nav a {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}
.public-nav a:hover { color: #fff; text-decoration: none; }

.public-hero-title {
  font-family: var(--ff-display);
  font-size: 40px;
  font-weight: 740;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.public-hero-sub {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.4;
}

.public-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 22px;
  border: none;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}
.public-btn:active { transform: scale(0.97); }
.public-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.public-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-deep));
  color: #fff;
  text-decoration: none;
}
.public-btn-secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  border: 1px solid rgba(255, 107, 171, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.public-btn-secondary:hover {
  background: #fff;
  color: var(--accent-deep);
  border-color: var(--accent);
  text-decoration: none;
}
.public-btn-dark {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
}
.public-btn-dark:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-deep));
  color: #fff;
  text-decoration: none;
}
.public-link-on-dark { color: var(--clr-primary-on-dark); }
.public-link-on-dark:hover { color: #ffb8d8; }

/* Key display */
.key-display {
  background: linear-gradient(180deg, #fafbfc 0%, #f3f4f6 100%);
  border: 1px dashed #d1d5db;
  border-radius: var(--r-md);
  padding: 16px 14px;
  font-family: var(--ff-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  word-break: break-all;
  color: var(--ink);
  margin: 12px 0 16px;
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  box-shadow: var(--shadow-xs);
}
.product-card:hover {
  border-color: rgba(255, 107, 171, 0.45);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.product-card .img-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  height: auto;
  overflow: hidden;
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}
.product-card:hover .img-wrap img { transform: scale(1.04); }
.product-card .img-wrap .placeholder,
.product-card .img-wrap span {
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 500;
}
.product-card .info { padding: 12px 14px 14px; }
.product-card .name {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .po {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Footer */
.site-footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 36px 20px;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--accent); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: 6px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  border-radius: var(--r-xs);
}
.hamburger:hover { background: rgba(255, 255, 255, 0.08); }
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 2px;
  transition: all 0.22s var(--ease);
}
.hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.4);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Public shared helpers ── */
.back-link {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  z-index: 20;
}
.back-link a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
}
.back-link a:hover { color: var(--accent-deep); }

.glass-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  font-size: 14px;
}

.cat-wrap { margin: 0 auto 18px; }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--t-fast);
  user-select: none;
  text-decoration: none;
}
.cat-tag:hover {
  border-color: rgba(255, 107, 171, 0.5);
  color: var(--accent-deep);
  text-decoration: none;
}
.cat-tag.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 107, 171, 0.28);
}

.search-wrap { margin: 0 auto 14px; }
.search-row {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.search-row:focus-within {
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.search-row input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}
.search-row input:focus {
  outline: none;
  box-shadow: none;
}
.search-row input::placeholder { color: var(--muted-2); }
.search-row button {
  width: 64px;
  border: none;
  background: transparent;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  flex-shrink: 0;
}
.search-row button:hover { opacity: 0.75; }

/* ── Responsive ── */
@media (max-width: 1068px) {
  .main-content { padding: 22px 20px 40px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content {
    margin-left: 0;
    max-width: 100%;
  }
  .top-bar { padding: 0 12px; }
  .top-bar .nav-right { gap: 10px; }
  .form-row { flex-direction: column; gap: 0; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  .main-content { padding: 16px 14px 36px; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 22px; }
  .card { padding: 16px; border-radius: var(--r-md); }
  .table-container { margin: 0 -4px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .public-hero-title { font-size: 28px; }
  .public-hero-sub { font-size: 16px; }
  .btn { font-size: 13px; padding: 7px 13px; }
  .modal-content, .modal-box { width: 100%; padding: 16px; border-radius: var(--r-lg); }
  .top-bar .nav-right span:not(.user-name) { display: none; }
  .flex-between { align-items: flex-start; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .public-hero-title { font-size: 24px; }
  .public-hero-sub { font-size: 15px; }
  .top-bar .nav-right { gap: 8px; }
  .top-bar .brand { font-size: 12px; }
}

@media print {
  .top-bar, .sidebar, .hamburger, .sidebar-overlay, .back-link { display: none !important; }
  .main-content { margin-left: 0; max-width: 100%; }
}
