/* ── TooSteppin Brand Portal — extracted from toosteppin.com ──────────────── */
/* Fonts: Roboto Slab (headings), Grandstander (brand), Inter (body)          */
/* Colors sourced from toosteppin.com Shopify theme CSS variables              */

:root {
  /* TooSteppin.com exact palette */
  --bg:          #ffffff;
  --bg-2:        #f3f3f3;
  --dark:        #242833;   /* color-scheme-3 background */
  --dark-2:      #2f3444;
  --text:        #121212;   /* color-scheme-1 foreground */
  --text-inv:    #ffffff;
  --accent:      #334fb4;   /* blue found in page source */
  --accent-dk:   #2840a0;
  --border:      #e5e7eb;
  --muted:       #6b7280;

  /* Sidebar */
  --sb-width:    240px;
  --sb-bg:       #242833;
  --sb-text:     rgba(255,255,255,0.85);
  --sb-muted:    rgba(255,255,255,0.45);
  --sb-active:   rgba(255,255,255,0.12);
  --sb-hover:    rgba(255,255,255,0.07);
  --sb-border:   rgba(255,255,255,0.08);

  /* Header */
  --hdr-h:       60px;

  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);

  --font-brand:  'Grandstander', cursive;
  --font-head:   'Roboto Slab', Georgia, serif;
  --font-body:   'Inter', system-ui, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg-2); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Site header ─────────────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--hdr-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 36px; height: 36px; background: none; border: none; cursor: pointer; padding: 6px;
}
.sidebar-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.site-logo { display: flex; align-items: baseline; gap: .4rem; text-decoration: none; flex-shrink: 0; }
.logo-brand { font-family: var(--font-brand); font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.logo-pipe  { color: var(--border); font-size: 1.1rem; }
.logo-sub   { font-family: var(--font-body); font-size: .75rem; font-weight: 500; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.header-search { flex: 1; max-width: 500px; display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.header-search input { flex: 1; border: none; background: transparent; padding: .45rem .85rem; font-size: .9rem; outline: none; color: var(--text); }
.header-search button { background: none; border: none; border-left: 1px solid var(--border); padding: 0 .85rem; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.header-search button:hover { background: var(--border); color: var(--text); }
.header-nav { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.btn-header { background: var(--dark); color: white; padding: .35rem .9rem; border-radius: 6px; font-size: .85rem; font-weight: 600; }
.btn-header:hover { background: var(--dark-2); text-decoration: none; }
.header-link { font-size: .85rem; color: var(--muted); }
.header-link:hover { color: var(--text); }

/* ── Flash ───────────────────────────────────────────────────────────────── */
.flash { padding: .75rem 1.5rem; font-size: .875rem; font-weight: 500; position: relative; z-index: 100; }
.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }

/* ── Portal two-column layout ────────────────────────────────────────────── */
.portal-body { display: flex; margin-top: var(--hdr-h); min-height: calc(100vh - var(--hdr-h)); }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-width); flex-shrink: 0;
  background: var(--sb-bg);
  position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h));
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  padding: .75rem 0;
}
.sidebar-top { padding: .25rem 0 .5rem; border-bottom: 1px solid var(--sb-border); margin-bottom: .5rem; }
.sidebar-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sb-muted); padding: .6rem 1rem .3rem; }
.sidebar-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1rem; text-decoration: none;
  color: var(--sb-text); font-size: .88rem; font-weight: 500;
  border-radius: 0; transition: background .1s;
  position: relative;
}
.sidebar-item:hover { background: var(--sb-hover); text-decoration: none; }
.sidebar-item.active { background: var(--sb-active); color: #fff; }
.sidebar-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 0 2px 2px 0; }
.sidebar-icon-svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.sidebar-emoji { font-size: 1rem; width: 20px; flex-shrink: 0; text-align: center; }
.sidebar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-count { font-size: .75rem; color: var(--sb-muted); background: rgba(255,255,255,.1); border-radius: 10px; padding: .1rem .45rem; flex-shrink: 0; }
.sidebar-all { font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 1rem; border-top: 1px solid var(--sb-border); }
.sidebar-admin-link { font-size: .78rem; color: var(--sb-muted); }
.sidebar-admin-link:hover { color: var(--sb-text); text-decoration: none; }
.sidebar-overlay { display: none; }

/* ── Main content ────────────────────────────────────────────────────────── */
.portal-main { flex: 1; min-width: 0; }
.main-header { background: var(--bg); border-bottom: 1px solid var(--border); padding: 1.75rem 2rem; }
.main-header-inner { display: flex; align-items: center; gap: 1.25rem; }
.portal-logo-img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.main-title { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.main-sub { font-size: .9rem; color: var(--muted); margin-top: .25rem; }
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); margin-bottom: .6rem; }
.breadcrumb a { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }
.main-content { padding: 1.75rem 2rem; }

/* ── Collection grid (homepage) ──────────────────────────────────────────── */
.section-label { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.collection-card { display: flex; align-items: center; gap: .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s, transform .15s; }
.collection-card:hover { box-shadow: var(--shadow); border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.collection-card-icon { font-size: 1.6rem; flex-shrink: 0; }
.collection-card-body { flex: 1; min-width: 0; }
.collection-card-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.collection-card-count { font-size: .78rem; color: var(--muted); }
.collection-card-arrow { color: var(--border); font-size: 1rem; flex-shrink: 0; }
.collection-card:hover .collection-card-arrow { color: var(--accent); }
.usage-notice { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: .85rem; color: var(--muted); }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.asset-count-label { font-size: .82rem; color: var(--muted); font-weight: 500; }

/* ── Asset grid ──────────────────────────────────────────────────────────── */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.asset-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, border-color .15s; display: flex; flex-direction: column; }
.asset-card:hover { box-shadow: var(--shadow); border-color: #d1d5db; }

.asset-thumb { position: relative; aspect-ratio: 1; background: var(--bg-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; padding: .75rem; transition: transform .2s; }
.asset-card:hover .asset-thumb img { transform: scale(1.03); }
.asset-file-icon { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--muted); }
.asset-file-icon svg { width: 40px; height: 40px; }
.asset-file-icon span { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.asset-overlay { position: absolute; inset: 0; background: rgba(36,40,51,.7); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.asset-card:hover .asset-overlay { opacity: 1; }
.btn-download { display: flex; align-items: center; gap: .4rem; background: var(--bg); color: var(--text); padding: .5rem 1.1rem; border-radius: 6px; font-size: .85rem; font-weight: 600; text-decoration: none; transition: background .1s; }
.btn-download:hover { background: var(--accent); color: white; text-decoration: none; }

.asset-info { padding: .75rem .9rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.asset-name { font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.asset-meta-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.asset-desc { font-size: .75rem; color: var(--muted); line-height: 1.4; margin-top: .15rem; }
.asset-collection-link { font-size: .75rem; color: var(--accent); }
.dl-count { font-size: .72rem; color: var(--muted); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .1rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); }
.badge-green { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

/* ── Brand color palette ─────────────────────────────────────────────────── */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.palette-swatch { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s; }
.palette-swatch:hover { box-shadow: var(--shadow); }
.swatch-block { height: 120px; display: flex; align-items: flex-end; justify-content: flex-start; padding: .85rem 1rem; transition: height .15s; }
.palette-swatch:hover .swatch-block { height: 140px; }
.swatch-hex { font-family: 'Roboto Slab', monospace; font-size: .95rem; font-weight: 700; letter-spacing: .04em; opacity: .9; }
.swatch-info { padding: .9rem 1rem 1rem; }
.swatch-name { font-weight: 700; font-size: .95rem; color: var(--text); margin-bottom: .3rem; }
.swatch-values { font-size: .78rem; color: var(--muted); font-family: monospace; letter-spacing: .02em; line-height: 1.6; }
.swatch-usage { font-size: .78rem; color: var(--muted); margin-top: .4rem; line-height: 1.5; font-style: italic; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.search-bar { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.search-bar input { flex: 1; padding: .6rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; background: var(--bg); outline: none; }
.search-bar input:focus { border-color: var(--accent); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state { padding: 4rem 2rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.empty-state svg { opacity: .3; }
.empty-state p { font-size: .95rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary { display: inline-flex; align-items: center; gap: .4rem; background: var(--text); color: white; padding: .5rem 1.1rem; border-radius: 6px; font-size: .875rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn-primary:hover { background: var(--accent); text-decoration: none; }
.btn-ghost { display: inline-flex; align-items: center; background: transparent; color: var(--text); padding: .5rem 1.1rem; border-radius: 6px; font-size: .875rem; font-weight: 500; border: 1px solid var(--border); cursor: pointer; text-decoration: none; transition: border-color .15s; }
.btn-ghost:hover { border-color: var(--text); text-decoration: none; }
.btn-danger { display: inline-flex; align-items: center; background: #ef4444; color: white; padding: .5rem 1.1rem; border-radius: 6px; font-size: .875rem; font-weight: 600; border: none; cursor: pointer; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Admin login ─────────────────────────────────────────────────────────── */
.admin-body { background: var(--bg-2); }
.admin-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.admin-login-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--shadow-lg); }
.admin-login-logo { font-size: 2.5rem; margin-bottom: .75rem; }
.admin-login-card h1 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: .25rem; }
.admin-login-card p { color: var(--muted); font-size: .875rem; margin-bottom: 1.5rem; }
.admin-login-card label { display: block; text-align: left; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.admin-login-card input { display: block; width: 100%; padding: .65rem 1rem; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; margin-bottom: 1.25rem; outline: none; }
.admin-login-card input:focus { border-color: var(--accent); }
.back-link { display: block; margin-top: 1.25rem; font-size: .82rem; color: var(--muted); }

/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-header { position: sticky; top: 0; z-index: 200; background: var(--dark); height: 56px; display: flex; align-items: center; padding: 0 1.5rem; gap: 2rem; box-shadow: var(--shadow-sm); }
.admin-logo { display: flex; align-items: center; gap: .5rem; color: white; font-weight: 600; font-size: 1rem; text-decoration: none; flex-shrink: 0; }
.admin-logo:hover { color: white; text-decoration: none; }
.admin-nav { display: flex; align-items: center; gap: 1.25rem; flex: 1; }
.admin-nav a { color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { color: white; text-decoration: none; }
.admin-nav .portal-link { margin-left: auto; color: rgba(255,255,255,.5); }
.admin-nav .logout-link { color: rgba(255,255,255,.4); }
.admin-main { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.admin-page-header h1 { font-family: var(--font-head); font-size: 1.5rem; }
.admin-page-narrow { max-width: 720px; margin: 0 auto; }
.admin-section-title { font-family: var(--font-head); font-size: 1.1rem; margin: 2rem 0 1rem; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.stat-num { font-family: var(--font-head); font-size: 2.25rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-lbl { font-size: .82rem; color: var(--muted); margin-top: .35rem; font-weight: 500; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem 2rem; }
.form-card h2 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 1.25rem; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea { padding: .55rem .85rem; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; font-family: inherit; background: var(--bg); color: var(--text); outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,79,180,.1); }
.req { color: #ef4444; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.form-actions { display: flex; gap: .75rem; padding-top: .5rem; }

.upload-zone { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.25rem; align-items: start; margin: 1.25rem 0; padding: 1.25rem; background: var(--bg-2); border-radius: var(--radius); border: 1px dashed var(--border); }
.upload-option h3 { font-size: .9rem; font-weight: 600; margin-bottom: .25rem; }
.upload-option p { font-size: .8rem; color: var(--muted); }
.upload-or { display: flex; align-items: center; font-size: .8rem; color: var(--muted); font-weight: 600; padding-top: 1.25rem; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { background: var(--bg-2); padding: .7rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.preview-cell { width: 64px; text-align: center; }
.thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 4px; background: var(--bg-2); }
.file-icon { font-size: 1.4rem; }
.actions-cell { white-space: nowrap; }
.row-dim td { opacity: .5; }
.edit-row td { background: var(--bg-2) !important; padding: 1.25rem 1rem !important; }
.inline-form .form-group { margin-bottom: .6rem; }
code { font-family: monospace; font-size: .82rem; background: var(--bg-2); padding: .15rem .4rem; border-radius: 4px; }
.count-label { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: .5rem .85rem; border: 1px solid var(--border); border-radius: 6px; font-size: .875rem; background: var(--bg); outline: none; }
.filter-bar input { flex: 1; min-width: 160px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sb-width: 240px; }
  .sidebar { position: fixed; top: var(--hdr-h); left: 0; bottom: 0; z-index: 150; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 140; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: flex; }
  .portal-body { display: block; }
  .main-header, .main-content { padding: 1.25rem 1rem; }
}
@media (max-width: 640px) {
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .collection-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .upload-zone { grid-template-columns: 1fr; }
  .admin-nav { gap: .75rem; }
  .admin-nav a { font-size: .8rem; }
}
@media (max-width: 400px) {
  .asset-grid { grid-template-columns: 1fr; }
}
