/* ══════════════════════════════════════════════════════
   JOG SPORTSWEAR — SIZE CHART SYSTEM
   style.css
══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ── BRAND (theme-invariant) ─────────────────────── */
:root {
  --ink: #0e0e12;
  --ink2: #16161e;
  --ink3: #1e1e2a;
  --accent: #e84f1d;
  --accent-dim: rgba(232,79,29,0.10);
  --accent-hover: #ff6233;
  --blue: #1d6fe8;
  --blue-dim: rgba(29,111,232,0.09);
  --green: #1db87e;
  --green-dim: rgba(29,184,126,0.10);
  --gold: #e8a81d;
  --rule-dark: #2a2a36;

  /* ── Light theme (default) ── */
  --bg: #f8f7f2;
  --surface: #ffffff;
  --surface-alt: #fafaf7;
  --surface-hover: #f5f3ec;
  --text: #0e0e12;
  --paper: #f8f7f2;
  --paper2: #f0efe9;
  --muted: #7a7a88;
  --rule: #e4e3dc;

  /* ── Sidebar — light mode ── */
  --sb-bg: #ffffff;
  --sb-border: #e4e3dc;
  --sb-label: #bbbbcc;
  --sb-text: #666677;
  --sb-text-hover: #111122;
  --sb-text-active: #0e0e12;
  --sb-active-bg: rgba(232,79,29,.10);
  --sb-hover-bg: rgba(0,0,0,.03);
  --sb-logo-name: #0e0e12;
  --sb-logo-sub: #aaaaaa;
  --sb-input-bg: #f0efe9;
  --sb-input-border: #ddddd5;
  --sb-input-text: #555566;
  --sb-input-focus-text: #0e0e12;
  --sb-input-ph: #aaaaaa;
  --sb-input-icon: #aaaaaa;
  --sb-badge-bg: #eeeee8;
  --sb-badge-text: #999999;
  --sb-username: #444455;
  --sb-userrole: #aaaaaa;
  --sb-upload-border: rgba(232,79,29,.18);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 58px;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

/* Logo filter — invert on dark mode so the black logo stays visible */
html[data-theme="dark"] { --logo-filter: invert(1) brightness(1.8); }

/* ── Dark theme overrides ────────────────────────── */
html[data-theme="dark"] {
  --bg: #12121c;
  --surface: #1c1c2a;
  --surface-alt: #191926;
  --surface-hover: #22222e;
  --text: #d8d8ec;
  --paper: #12121c;
  --paper2: #191926;
  --muted: #6a6a88;
  --rule: #2a2a3a;

  /* ── Sidebar — dark mode ── */
  --sb-bg: #0e0e12;
  --sb-border: #2a2a36;
  --sb-label: #2e2e3e;
  --sb-text: #555566;
  --sb-text-hover: #999999;
  --sb-text-active: #ffffff;
  --sb-active-bg: rgba(232,79,29,.12);
  --sb-hover-bg: rgba(255,255,255,.03);
  --sb-logo-name: #ffffff;
  --sb-logo-sub: #444455;
  --sb-input-bg: #1e1e2a;
  --sb-input-border: #2a2a36;
  --sb-input-text: #aaaaaa;
  --sb-input-focus-text: #ffffff;
  --sb-input-ph: #444455;
  --sb-input-icon: #444455;
  --sb-badge-bg: #1e1e2a;
  --sb-badge-text: #444455;
  --sb-username: #999999;
  --sb-userrole: #333344;
  --sb-upload-border: rgba(232,79,29,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background .2s, color .2s;
}

/* ── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3a50; }

/* ══ SIDEBAR ══════════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sb-bg);
  z-index: 300;
  display: flex; flex-direction: column;
  overflow: hidden; transition: transform .25s ease, background .2s;
  border-right: 1px solid var(--sb-border);
}

.sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-box {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.logo-text strong {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--sb-logo-name); display: block; letter-spacing: 0.3px;
}
.logo-text span { font-size: 10px; color: var(--sb-logo-sub); font-family: var(--mono); }

.sidebar-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-search-wrap { position: relative; }
.sb-search-wrap input {
  width: 100%; background: var(--sb-input-bg);
  border: 1px solid var(--sb-input-border);
  border-radius: 6px; padding: 7px 10px 7px 30px;
  color: var(--sb-input-text); font-size: 12px; font-family: var(--sans);
  transition: border-color .2s;
}
.sb-search-wrap input:focus { outline: none; border-color: var(--accent); color: var(--sb-input-focus-text); }
.sb-search-wrap input::placeholder { color: var(--sb-input-ph); }
.sb-search-wrap .si {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%); color: var(--sb-input-icon);
  font-size: 12px; pointer-events: none;
}

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

.nav-group-label {
  padding: 14px 16px 5px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--sb-label);
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px; color: var(--sb-text);
  cursor: pointer; font-size: 12.5px;
  transition: all .12s; position: relative;
  user-select: none; border: none; background: none; width: 100%;
  text-align: left; text-decoration: none;
}
.nav-item:hover { color: var(--sb-text-hover); background: var(--sb-hover-bg); }
.nav-item.active { color: var(--sb-text-active); background: var(--sb-active-bg); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.nav-item .ni { font-size: 13px; width: 15px; text-align: center; flex-shrink: 0; }
.nav-item.active .ni { color: var(--accent); }
.nav-item .nc {
  margin-left: auto; background: var(--sb-badge-bg); color: var(--sb-badge-text);
  border-radius: 10px; padding: 1px 7px;
  font-family: var(--mono); font-size: 9.5px;
}
.nav-item.active .nc { background: rgba(232,79,29,.18); color: var(--accent); }
.nav-item.upload-btn {
  color: var(--accent); background: rgba(232,79,29,.06);
  border-top: 1px solid var(--sb-upload-border);
  margin-top: 6px;
}
.nav-item.upload-btn:hover { background: rgba(232,79,29,.12); }

.sidebar-user {
  padding: 11px 16px;
  border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.user-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 600; color: var(--sb-username); }
.user-role { font-size: 10px; color: var(--sb-userrole); font-family: var(--mono); }

/* Logout button inside sidebar uses sidebar palette */
.sidebar .btn-icon {
  background: var(--sb-input-bg);
  border-color: var(--sb-border);
  color: var(--sb-text);
}
.sidebar .btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ══ TOPBAR ═══════════════════════════════════════ */
.topbar {
  position: fixed; left: var(--sidebar-w); right: 0; top: 0;
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  z-index: 200;
  transition: background .2s, border-color .2s;
}
.topbar-title { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); }
.topbar-bc { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.topbar-bc .bc-link { color: var(--accent); cursor: pointer; }
.topbar-bc .bc-link:hover { text-decoration: underline; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── THEME TOGGLE ─────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 7px;
  border: 1px solid var(--rule); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; color: var(--muted);
  transition: all .15s; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent); color: white; border: none;
  border-radius: 7px; padding: 8px 16px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 6px; font-family: var(--sans);
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--rule); border-radius: 7px;
  padding: 8px 14px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 6px; font-family: var(--sans);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon {
  width: 34px; height: 34px; border-radius: 7px;
  border: 1px solid var(--rule); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; color: var(--muted);
  transition: all .15s; text-decoration: none;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ══ MAIN ═════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
.page { display: none; padding: 24px; animation: pgIn .18s ease; }
.page.active { display: block; }
@keyframes pgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ══ STAT CARDS ═══════════════════════════════════ */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; padding: 18px 20px;
  position: relative; overflow: hidden; transition: box-shadow .2s, background .2s;
}
.stat-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.c-red::before { background: var(--accent); }
.stat-card.c-blue::before { background: var(--blue); }
.stat-card.c-green::before { background: var(--green); }
.stat-card.c-gold::before { background: var(--gold); }
.stat-num { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1; margin-bottom: 5px; }
.stat-card.c-red .stat-num { color: var(--accent); }
.stat-card.c-blue .stat-num { color: var(--blue); }
.stat-card.c-green .stat-num { color: var(--green); }
.stat-card.c-gold .stat-num { color: var(--gold); }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.stat-delta { font-size: 10.5px; color: var(--green); font-family: var(--mono); margin-top: 3px; }
.stat-ico { position: absolute; right: 16px; top: 14px; font-size: 26px; opacity: .07; }
.stat-card.c-red .stat-ico { color: var(--accent); }
.stat-card.c-blue .stat-ico { color: var(--blue); }
.stat-card.c-green .stat-ico { color: var(--green); }
.stat-card.c-gold .stat-ico { color: var(--gold); }

/* ══ SECTION HEADER ═══════════════════════════════ */
.sec-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-title { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.sec-rule { flex: 1; height: 1px; background: var(--rule); }
.sec-action { font-size: 11.5px; color: var(--accent); cursor: pointer; white-space: nowrap; }
.sec-action:hover { text-decoration: underline; }

/* ══ SPORT GRID ═══════════════════════════════════ */
.sport-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 26px; }
.sport-chip {
  background: var(--surface); border: 1.5px solid var(--rule);
  border-radius: 10px; padding: 13px 10px;
  text-align: center; cursor: pointer; transition: all .18s;
}
.sport-chip:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(232,79,29,.1); }
.sport-chip.sel { border-color: var(--accent); background: var(--accent-dim); }
.sport-chip-em { font-size: 22px; margin-bottom: 5px; }
.sport-chip-name { font-size: 10.5px; font-weight: 600; }
.sport-chip-cnt { font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-top: 2px; }

/* ══ BROWSE TOOLBAR ════════════════════════════════ */
.browse-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.search-input {
  width: 100%; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; padding: 8px 12px 8px 34px;
  font-size: 13px; font-family: var(--sans); color: var(--text);
  transition: border-color .18s, background .2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-sel {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 7px; padding: 8px 12px; font-size: 12.5px;
  font-family: var(--sans); color: var(--text); cursor: pointer;
  transition: background .2s;
}
.filter-sel:focus { outline: none; border-color: var(--accent); }
.view-toggle { display: flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; }
.view-btn { padding: 7px 11px; background: var(--surface); border: none; cursor: pointer; font-size: 13px; color: var(--muted); transition: all .12s; }
.view-btn.active { background: var(--accent); color: white; }

/* ══ CHART CARDS GRID ═════════════════════════════ */
.cards-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.cards-grid.list { grid-template-columns: 1fr; }

.chart-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: all .18s;
  display: flex; flex-direction: column;
}
.chart-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.14); transform: translateY(-2px); }

.card-img-strip {
  height: 130px; overflow: hidden; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.card-img-strip img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 8px; transition: transform .3s;
}
.chart-card:hover .card-img-strip img { transform: scale(1.04); }
.card-img-count {
  position: absolute; bottom: 6px; right: 8px;
  background: rgba(14,14,18,.6); color: white;
  font-family: var(--mono); font-size: 9px;
  padding: 2px 7px; border-radius: 8px;
}
.card-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; opacity: .3;
}

.card-body { padding: 14px 15px 12px; flex: 1; }
.card-badges { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 7px; border-radius: 3px;
  font-family: var(--mono); text-transform: uppercase;
}
.badge-cat { background: var(--paper2); color: var(--muted); }
.badge-hockey  { background: #eef0ff; color: var(--blue); }
.badge-soccer  { background: var(--green-dim); color: var(--green); }
.badge-football{ background: #fff3ea; color: #e87b1d; }
.badge-basketball{ background: #fffbea; color: #cc8800; }
.badge-baseball{ background: #fff0f5; color: #cc006a; }
.badge-softball{ background: #fff0f5; color: #cc006a; }
.badge-lacrosse{ background: #f0faf5; color: var(--green); }
.badge-rugby   { background: #eef0ff; color: var(--blue); }
.badge-hoodie  { background: var(--accent-dim); color: var(--accent); }
.badge-tracksuit{background: var(--accent-dim); color: var(--accent); }
.badge-jacket  { background: #f5eeff; color: #7700cc; }
.badge-shirt   { background: #eef0ff; color: var(--blue); }
.badge-polo    { background: #f0faf5; color: var(--green); }
.badge-shorts  { background: #fffbea; color: #cc8800; }
.badge-pants   { background: var(--paper2); color: var(--muted); }
.badge-men     { background: var(--blue-dim); color: var(--blue); }
.badge-women   { background: #ffeef5; color: #cc006a; }
.badge-unisex  { background: var(--paper2); color: var(--muted); }

/* Dark mode badge adjustments */
html[data-theme="dark"] .badge-hockey   { background: rgba(29,111,232,.18); }
html[data-theme="dark"] .badge-football { background: rgba(232,123,29,.18); }
html[data-theme="dark"] .badge-basketball { background: rgba(204,136,0,.18); }
html[data-theme="dark"] .badge-baseball,
html[data-theme="dark"] .badge-softball { background: rgba(204,0,106,.18); }
html[data-theme="dark"] .badge-lacrosse { background: rgba(29,184,126,.18); }
html[data-theme="dark"] .badge-rugby    { background: rgba(29,111,232,.18); }
html[data-theme="dark"] .badge-jacket   { background: rgba(119,0,204,.18); }
html[data-theme="dark"] .badge-shirt    { background: rgba(29,111,232,.18); }
html[data-theme="dark"] .badge-polo     { background: rgba(29,184,126,.18); }
html[data-theme="dark"] .badge-shorts   { background: rgba(204,136,0,.18); }
html[data-theme="dark"] .badge-women    { background: rgba(204,0,106,.18); }
html[data-theme="dark"] .action-login   { background: rgba(29,111,232,.18); }
html[data-theme="dark"] .action-edit    { background: rgba(204,136,0,.18); }
html[data-theme="dark"] .action-admin   { background: rgba(119,0,204,.18); }

.card-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; line-height: 1.3; }
.card-sheet { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

.card-footer {
  padding: 10px 15px; border-top: 1px solid var(--rule);
  display: flex; align-items: center; gap: 8px;
}
.ver-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: var(--green-dim); color: var(--green);
  padding: 2px 8px; border-radius: 8px;
}
.sizes-badge {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted);
}
.card-actions { margin-left: auto; display: flex; gap: 5px; }
.ca-btn {
  width: 28px; height: 28px; border-radius: 5px;
  border: 1px solid var(--rule); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; color: var(--muted);
  transition: all .12s;
}
.ca-btn:hover { border-color: var(--accent); color: var(--accent); }
.ca-btn.dl { background: var(--accent); border-color: var(--accent); color: white; }
.ca-btn.dl:hover { background: var(--accent-hover); }

/* List view */
.cards-grid.list .chart-card { flex-direction: row; border-radius: 8px; }
.cards-grid.list .card-img-strip { width: 100px; height: auto; min-height: 80px; border-radius: 0; flex-shrink: 0; }
.cards-grid.list .card-body { padding: 12px 14px; display: flex; align-items: center; gap: 14px; }
.cards-grid.list .card-body .card-title { font-size: 13px; margin-bottom: 2px; }
.cards-grid.list .card-footer { border-top: none; border-left: 1px solid var(--rule); flex-shrink: 0; min-width: 180px; }

/* ══ DETAIL PAGE ══════════════════════════════════ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer;
  transition: color .12s; margin-bottom: 14px; font-weight: 500;
  background: none; border: none; font-family: var(--sans);
}
.back-btn:hover { color: var(--accent); }

.detail-header {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
}
.detail-meta { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.detail-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; line-height: 1.2; }
.detail-sheet { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 12px; }
.detail-acts { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* Split layout: images left, table right */
.detail-split {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

/* IMAGE PANEL */
.img-panel {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 12px; overflow: hidden; position: sticky; top: calc(var(--topbar-h) + 16px);
}
.img-panel-header {
  padding: 10px 16px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
}
.img-panel-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.img-nav { display: flex; gap: 6px; align-items: center; }
.img-nav-btn {
  width: 26px; height: 26px; border-radius: 5px;
  border: 1px solid var(--rule); background: var(--surface);
  cursor: pointer; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.img-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.img-nav-btn:disabled { opacity: .35; cursor: default; }
.img-counter { font-family: var(--mono); font-size: 10px; color: var(--muted); min-width: 36px; text-align: center; }
.img-main {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); min-height: 280px; padding: 16px; cursor: zoom-in;
}
.img-main img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 4px; }
.img-no-diag {
  text-align: center; padding: 40px 20px; color: var(--muted); min-height: 280px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.img-no-diag .big-em { font-size: 40px; margin-bottom: 10px; opacity: .3; }
.img-thumbs {
  display: flex; gap: 6px; padding: 10px; overflow-x: auto;
  border-top: 1px solid var(--rule); background: var(--paper2);
}
.img-thumb {
  width: 52px; height: 52px; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
  transition: border-color .12s;
}
.img-thumb.active { border-color: var(--accent); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-fullbtn {
  display: block; width: 100%;
  padding: 9px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  border-top: 1px solid var(--rule); cursor: pointer;
  background: none; border-left: none; border-right: none; border-bottom: none;
  font-family: var(--sans); transition: background .12s;
}
.img-fullbtn:hover { background: var(--accent-dim); }

/* TABLE PANEL */
/* The right grid column needs min-width:0 so the 1fr track can shrink and the table scrolls horizontally */
.detail-split > div:last-child { min-width: 0; }
.table-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.table-panel-header {
  padding: 12px 18px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.table-panel-title { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.table-units { font-size: 11px; color: var(--muted); margin-left: auto; }
.table-scroll { overflow-x: auto; max-height: 600px; overflow-y: auto; }

.size-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.size-table thead th {
  background: var(--ink2); color: white;
  padding: 9px 12px; font-family: var(--mono);
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
  text-align: center; position: sticky; top: 0; z-index: 2;
}
.size-table thead th:first-child {
  text-align: left; min-width: 210px; position: sticky;
  left: 0; z-index: 3; background: var(--ink);
}
.size-table tbody tr { border-bottom: 1px solid var(--rule); }
.size-table tbody tr:nth-child(even) { background: var(--surface-alt); }
.size-table tbody tr:hover { background: var(--surface-hover); }
.size-table tbody td {
  padding: 8px 12px; text-align: center;
  font-family: var(--mono); font-size: 11.5px; white-space: nowrap;
}
.size-table tbody td:first-child {
  text-align: left; font-family: var(--sans); font-size: 12px;
  font-weight: 500; position: sticky; left: 0; z-index: 1;
  background: var(--surface); border-right: 1px solid var(--rule);
}
.size-table tbody tr:nth-child(even) td:first-child { background: var(--surface-alt); }
.size-table tbody tr:hover td:first-child { background: var(--surface-hover); }
.row-no { font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-right: 7px; }
.no-data-cell { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* ══ SEARCH PAGE ══════════════════════════════════ */
.search-hero {
  background: var(--ink); border-radius: 12px;
  padding: 24px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.search-hero::after {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: var(--accent); opacity: .05;
}
.hero-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 2.5px; text-transform: uppercase; color: #333344; margin-bottom: 10px; }
.hero-title { font-size: 18px; font-weight: 700; color: white; margin-bottom: 14px; }
.hero-search-wrap { position: relative; }
.hero-search-wrap .si { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #444455; font-size: 16px; }
.hero-input {
  width: 100%; background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 9px; padding: 13px 16px 13px 44px;
  font-size: 14px; color: white; font-family: var(--sans); transition: all .2s;
}
.hero-input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.1); }
.hero-input::placeholder { color: #333344; }

.results-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.results-count strong { color: var(--text); }
.results-group { margin-bottom: 22px; }
.results-group-title {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.results-group-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.hl { background: rgba(232,79,29,.13); color: var(--accent); border-radius: 2px; padding: 0 2px; }

/* ══ UPLOAD MODAL ═════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(14,14,18,.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 14px;
  width: 540px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px); overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: mIn .2s ease;
  border: 1px solid var(--rule);
}
@keyframes mIn { from { opacity:0; transform: translateY(-14px) scale(.98); } to { opacity:1; transform: translateY(0) scale(1); } }
.modal-hdr {
  padding: 20px 24px 14px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 10px;
}
.modal-title { font-size: 17px; font-weight: 700; flex: 1; }
.modal-close-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--rule); background: var(--surface);
  cursor: pointer; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.modal-close-btn:hover { border-color: var(--accent); color: var(--accent); }
.modal-body { padding: 20px 24px; }
.modal-ftr { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; letter-spacing: 0.5px; color: var(--text); margin-bottom: 5px;
}
.form-control {
  width: 100%; background: var(--bg); border: 1.5px solid var(--rule);
  border-radius: 7px; padding: 9px 12px; font-size: 13px;
  color: var(--text); font-family: var(--sans); transition: border-color .18s, background .2s;
}
.form-control:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.form-control::placeholder { color: var(--muted); }
.drop-zone {
  border: 2px dashed var(--rule); border-radius: 9px;
  padding: 28px 16px; text-align: center; cursor: pointer;
  transition: all .18s; background: var(--bg);
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-dim); }
.drop-ico { font-size: 28px; color: var(--muted); margin-bottom: 8px; }
.drop-txt { font-size: 13px; color: var(--muted); }
.drop-txt strong { color: var(--accent); }
.drop-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.drop-file { margin-top: 8px; font-size: 12px; color: var(--green); font-weight: 600; display: none; }
.ver-preview {
  background: var(--green-dim); border: 1px solid rgba(29,184,126,.2);
  border-radius: 7px; padding: 10px 14px; margin-top: 10px;
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
}
.prog-wrap { margin-top: 10px; display: none; }
.prog-bar { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .25s ease; width: 0; }

/* ══ LIGHTBOX ═════════════════════════════════════ */
.lb-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.93); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
  cursor: zoom-out;
}
.lb-overlay.show { display: flex; }
.lb-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.lb-inner img { max-width: 100%; max-height: 92vh; display: block; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-close {
  position: absolute; top: -14px; right: -14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); border: none; color: white;
  font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; color: white;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .12s;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-nav.prev { left: -48px; }
.lb-nav.next { right: -48px; }
.lb-counter { text-align: center; margin-top: 10px; font-size: 11px; color: rgba(255,255,255,.4); font-family: var(--mono); }

/* ══ TOAST ════════════════════════════════════════ */
.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink2); color: white; border-radius: 9px;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; max-width: 300px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: tIn .25s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--accent); }
@keyframes tIn { from { opacity:0; transform: translateX(16px); } to { opacity:1; transform: translateX(0); } }

/* ══ IMAGE MANAGEMENT ═════════════════════════════ */
.img-upload-drop {
  border: 2px dashed var(--rule); border-radius: 10px;
  padding: 22px 18px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 13px; transition: border-color .15s, background .15s;
}
.img-upload-drop:hover, .img-upload-drop.dragging {
  border-color: var(--accent); background: var(--accent-dim);
}
.img-mgmt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.img-mgmt-card {
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  background: var(--surface-alt);
}
.img-mgmt-card img {
  width: 100%; height: 100px; object-fit: contain;
  background: var(--paper2); display: block; padding: 6px;
}
.img-mgmt-info {
  padding: 6px 8px; border-top: 1px solid var(--rule);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
}

/* ══ EMPTY STATE ══════════════════════════════════ */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 12px; opacity: .25; }
.empty h5 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }

/* ══ RESPONSIVE ═══════════════════════════════════ */
@media (max-width: 1100px) {
  .detail-split { grid-template-columns: 280px 1fr; }
  .cards-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .sport-grid { grid-template-columns: repeat(4,1fr); }
  .detail-split { grid-template-columns: 1fr; }
  .img-panel { position: static; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 248px; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ══ PHP-SPECIFIC ADDITIONS ═══════════════════════ */

/* Page content wrapper */
.page-content { padding: 24px; max-width: 1400px; }

/* Flash messages */
.flash {
  padding: 12px 18px; border-radius: 8px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500;
}
.flash-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(29,184,126,.2); }
.flash-error   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,79,29,.2); }

/* Panel */
.panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
}

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--rule); background: var(--surface); border-radius: 12px 12px 0 0; overflow: hidden; }
.tab {
  padding: 12px 20px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--muted); font-family: var(--sans);
  border-bottom: 2.5px solid transparent; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(232,79,29,.03); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead th {
  background: var(--paper2); padding: 10px 14px;
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.data-table tbody tr { border-bottom: 1px solid var(--rule); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table td { padding: 9px 14px; }
.data-table a { color: var(--accent); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.text-muted { color: var(--muted); }

/* Action badges */
.action-badge {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 3px; text-transform: uppercase;
}
.action-upload   { background: var(--green-dim); color: var(--green); }
.action-download { background: var(--blue-dim); color: var(--blue); }
.action-view     { background: var(--paper2); color: var(--muted); }
.action-login    { background: #eef0ff; color: var(--blue); }
.action-logout   { background: var(--paper2); color: var(--muted); }
.action-edit     { background: #fffbea; color: #cc8800; }
.action-delete   { background: var(--accent-dim); color: var(--accent); }
.action-admin    { background: #f5eeff; color: #7700cc; }
.action-merchandising { background: var(--green-dim); color: var(--green); }
.action-sales    { background: var(--blue-dim); color: var(--blue); }

/* Version latest badge */
.ver-latest { background: rgba(29,184,126,.04); }
.badge-latest {
  background: var(--green); color: white;
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 2px; margin-left: 5px;
}

/* Link wrap on cards */
.card-link-wrap { text-decoration: none; color: inherit; display: block; }
.card-link-wrap:hover { color: inherit; }

/* ca-badge (image count) */
.ca-badge {
  font-size: 10px; color: var(--muted); display: flex;
  align-items: center; gap: 3px; white-space: nowrap;
}

/* Results group */
.results-group { margin-bottom: 24px; }
.results-group-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.results-group-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

/* Topbar bc */
.topbar-bc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bc-link { color: var(--accent); text-decoration: none; }
.bc-link:hover { text-decoration: underline; }
.bc-current { color: var(--text); font-weight: 600; }

/* No data */
.no-data-cell { padding: 36px; text-align: center; color: var(--muted); font-size: 13px; }

/* ══ SIDEBAR COLLAPSE ══════════════════════════════ */
.sidebar   { transition: width .25s ease, transform .25s ease, background .2s; }
.topbar    { transition: left .25s ease, background .2s, border-color .2s; }
.main      { transition: margin-left .25s ease; }
.sidebar.collapsed             { width: 0 !important; border-right-width: 0; }
.topbar.sb-col                 { left: 0 !important; }
.main.sb-col                   { margin-left: 0 !important; }
@media (max-width: 700px) {
  .topbar.sb-col, .main.sb-col { left: 0; margin-left: 0; } /* already 0 on mobile */
}
.sb-toggle {
  width: 34px; height: 34px; border-radius: 7px;
  border: 1px solid var(--rule); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--muted);
  transition: all .15s; flex-shrink: 0;
}
.sb-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ══ ADMIN USER MANAGEMENT ═════════════════════════ */
.btn-danger {
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 5px 11px; font-size: 11.5px;
  font-weight: 600; cursor: pointer; transition: opacity .15s;
  font-family: var(--sans);
}
.btn-danger:hover { opacity: .82; }
.btn-sm { padding: 5px 11px !important; font-size: 11.5px !important; border-radius: 6px !important; }
.role-sel {
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: 5px; padding: 3px 7px; font-size: 11.5px;
  color: var(--text); font-family: var(--sans); cursor: pointer;
}
.role-sel:focus { outline: none; border-color: var(--accent); }
.user-inactive td { opacity: .55; }
.status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px;
}
.status-dot.active   { background: var(--green); }
.status-dot.inactive { background: var(--muted); }
