/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #334155;
  --text: #0f172a;
  --text-sec: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-text: #4338ca;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #059669;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #dc2626;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f1f5f9; border-color: var(--border-strong); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger-ghost:hover { background: var(--danger-light); border-color: var(--danger); }
.btn-link { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; font-family: var(--font); }
.btn-link:hover { color: var(--accent-text); }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-sec); padding: 6px; border-radius: var(--radius); transition: all var(--transition); display: flex; align-items: center; font-size: 18px; }
.btn-icon:hover { background: #f1f5f9; color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ========== FORM ELEMENTS ========== */
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; font-family: var(--font);
  color: var(--text); background: #fff; transition: all var(--transition); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
textarea { resize: vertical; line-height: 1.6; }
.fg { margin-bottom: 16px; }
.fg label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--text-muted); }
.input-icon input { padding-left: 38px; }

/* ========== LOGIN ========== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}
.login-box {
  width: 400px; background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 44px 36px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.login-icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), #818cf8); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 28px;
}
.login-brand {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), #818cf8); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 28px;
}
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.5px; }
.login-sub { font-size: 14px; color: var(--text-sec); margin-bottom: 28px; }
.login-form { text-align: left; }
.login-error { color: var(--danger); font-size: 12px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ========== APP LAYOUT ========== */
.app { display: flex; min-height: 100vh; }

/* ========== SIDEBAR ========== */
.sidebar {
  width: 250px; background: var(--bg-sidebar); display: flex;
  flex-direction: column; flex-shrink: 0; color: var(--text-sidebar);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-brand {
  padding: 24px 20px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #818cf8); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.brand-text { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--text-sidebar); margin-top: 1px; }
.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.25); padding: 16px 10px 8px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-sidebar); cursor: pointer;
  transition: all var(--transition); border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
}
.nav-item i { font-size: 18px; width: 22px; text-align: center; }
.nav-item:hover { background: var(--bg-sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: var(--bg-sidebar-active); color: #fff; font-weight: 500; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.08); color: var(--text-sidebar);
  padding: 2px 8px; border-radius: 99px; min-width: 24px; text-align: center;
}
.nav-item.active .nav-badge { background: var(--accent); color: #fff; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-info { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(99,102,241,0.3); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-name { font-size: 13px; font-weight: 500; color: #fff; }
.user-status { font-size: 11px; color: var(--text-sidebar); }
.sidebar-footer .btn-icon { color: var(--text-sidebar); margin-left: auto; }
.sidebar-footer .btn-icon:hover { background: var(--bg-sidebar-hover); color: #fff; }

/* ========== MAIN AREA ========== */
.main { flex: 1; margin-left: 250px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  padding: 0 28px; height: 64px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-weight: 600; font-size: 17px; flex: 1; letter-spacing: -0.2px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 14px; width: 300px;
  transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.search-box i { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-box input { border: none; background: none; padding: 9px 0; font-size: 13px; outline: none; color: var(--text); font-family: var(--font); width: 100%; }
.mobile-menu { display: none; }
.content { flex: 1; padding: 28px; }
.page { display: none; }
.page.active { display: block; }

/* ========== STATS CARDS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden; transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.s-companies::before { background: var(--accent); }
.stat-card.s-total::before { background: var(--text); }
.stat-card.s-pending::before { background: var(--warning); }
.stat-card.s-available::before { background: var(--success); }
.stat-card.s-review::before { background: #3b82f6; }
.stat-card.s-sold::before { background: var(--text-muted); }
.s-pending .stat-icon { background: var(--warning-light); color: var(--warning); }
.s-review .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 20px;
}
.s-companies .stat-icon { background: var(--accent-light); color: var(--accent); }
.s-total .stat-icon { background: #f1f5f9; color: var(--text); }
.s-available .stat-icon { background: var(--success-light); color: var(--success); }
.s-sold .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-num { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 2px; }
.stat-label { font-size: 13px; color: var(--text-sec); }

/* ========== DATA TABLE ========== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
  padding: 0 16px 12px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table tbody tr { cursor: pointer; transition: background var(--transition); }
.data-table tbody tr:hover td { background: #f8fafc; }
.co-cell { display: flex; align-items: center; gap: 12px; }
.co-avatar {
  width: 36px; height: 36px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.co-title { font-weight: 500; font-size: 14px; }
.co-desc { font-size: 12px; color: var(--text-sec); margin-top: 1px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 600;
}
.badge-green { background: var(--success-light); color: var(--success-text); }
.badge-red { background: var(--danger-light); color: var(--danger-text); }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-amber { background: var(--warning-light); color: #b45309; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ========== SECTION HEADER ========== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-weight: 600; font-size: 16px; }

/* ========== COMPANY DETAIL ========== */
.detail-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 24px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.back-btn { margin-right: 4px; }
.detail-logo {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; flex-shrink: 0;
  background-size: cover; background-position: center;
}
.detail-info { flex: 1; }
.detail-name { font-weight: 600; font-size: 20px; letter-spacing: -0.3px; margin-bottom: 4px; }
.detail-meta { font-size: 13px; color: var(--text-sec); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-meta i { font-size: 14px; }
.detail-actions { display: flex; gap: 8px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.detail-stat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.detail-stat-label { font-size: 12px; color: var(--text-sec); margin-bottom: 4px; }
.detail-stat-num { font-size: 22px; font-weight: 600; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 12px 24px; font-size: 14px; color: var(--text-sec);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; transition: all var(--transition);
  display: flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count {
  font-size: 12px; background: var(--bg); padding: 1px 8px;
  border-radius: 99px; font-weight: 600;
}
.tab.active .tab-count { background: var(--accent-light); color: var(--accent-text); }

/* ========== ITEMS TOOLBAR ========== */
.items-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-left: auto; }
.view-btn {
  padding: 7px 11px; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; transition: all var(--transition);
}
.view-btn.active { background: var(--accent-light); color: var(--accent); }
.view-btn:hover:not(.active) { background: #f1f5f9; }

/* ========== ITEM CARDS ========== */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.item-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all var(--transition);
}
.item-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.item-card.sold-card { opacity: 0.72; }
.trash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.trash-card { opacity: 0.8; border-style: dashed; }
.trash-card:hover { opacity: 1; }
.item-img {
  height: 130px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-img i { font-size: 32px; color: var(--text-muted); }
.item-status { position: absolute; top: 10px; right: 10px; }
.item-company-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; background: rgba(0,0,0,0.6); color: #fff;
  padding: 2px 8px; border-radius: 99px; font-weight: 500;
  backdrop-filter: blur(4px);
}
.item-body { padding: 14px 16px; }
.item-name {
  font-weight: 600; font-size: 14px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.item-pts { list-style: none; }
.item-pts li {
  font-size: 12px; color: var(--text-sec); padding: 6px 0;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.item-pts li:last-child { border-bottom: none; }
.item-pts li i { font-size: 14px; color: var(--text-muted); width: 18px; text-align: center; flex-shrink: 0; }
.item-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border);
}
.copy-btn {
  display: flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 5px 12px; cursor: pointer; border: 1px solid var(--border);
  border-radius: var(--radius); background: none; color: var(--text-sec);
  font-family: var(--font); transition: all var(--transition);
}
.copy-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { background: var(--success-light); color: var(--success); border-color: var(--success); }
.img-count { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.item-actions { display: flex; gap: 4px; }
.item-actions .btn-icon { font-size: 15px; padding: 4px; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; margin: 0 auto 20px; font-size: 30px; color: var(--text-muted);
}
.empty-title { font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.empty-desc { font-size: 14px; color: var(--text-sec); margin-bottom: 24px; }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 24px; backdrop-filter: blur(4px); overflow-y: auto;
}
.modal {
  background: var(--bg-card); border-radius: var(--radius-xl);
  width: 100%; max-width: 480px; margin: auto;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-lg { max-width: 560px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  position: sticky; top: 0; background: var(--bg-card); z-index: 2;
}
.modal-header h3 { font-weight: 600; font-size: 17px; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ========== UPLOAD ========== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer; transition: all var(--transition);
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-light); }
.upload-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 20px;
}
.upload-text { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.upload-hint { font-size: 11px; color: var(--text-muted); }
.upload-preview { position: relative; display: inline-block; margin-top: 10px; }
.upload-preview img { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border); }
.remove-preview { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; width: 22px; height: 22px; border-radius: 50%; padding: 0; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* ========== STATUS RADIO ========== */
.status-radio { display: flex; gap: 10px; }
.status-radio-4 { flex-wrap: wrap; }
.status-radio-4 .status-opt { flex: 1 1 calc(50% - 5px); min-width: 120px; }
.status-opt { flex: 1; cursor: pointer; }
.status-opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-weight: 500; transition: all var(--transition);
}
.status-opt input:checked + .opt-pending { border-color: var(--warning); background: var(--warning-light); color: #b45309; }
.status-opt input:checked + .opt-avail { border-color: var(--success); background: var(--success-light); color: var(--success-text); }
.status-opt input:checked + .opt-review { border-color: #3b82f6; background: #eff6ff; color: #2563eb; }
.status-opt input:checked + .opt-sold { border-color: var(--text-muted); background: #f1f5f9; color: #475569; }
.opt-label:hover { background: #f8fafc; }
.label-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ========== THUMBNAILS ========== */
.thumb-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  width: 76px; height: 76px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; border: 1px solid var(--border); overflow: hidden;
  background: var(--bg);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-add {
  border-style: dashed; border-width: 2px; cursor: pointer;
  color: var(--text-muted); gap: 2px; font-size: 11px; transition: all var(--transition);
}
.thumb-add i { font-size: 20px; }
.thumb-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.thumb-rm {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--danger); color: #fff;
  border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 10px; padding: 0;
}

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-sidebar); color: #fff; padding: 12px 24px;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: all 0.3s ease; z-index: 300; pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== SKELETON ========== */
.skeleton { background: linear-gradient(90deg, var(--bg) 25%, #e2e8f0 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

#storefront {
  display: flex; flex-direction: column; min-height: 100vh;
}
.sf-content { flex: 1; }

/* ===================================================================
   PUBLIC STOREFRONT
   =================================================================== */

/* Header */
.sf-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.sf-header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; gap: 20px;
}
.sf-brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  text-decoration: none;
}
.sf-brand .brand-icon {
  width: 36px; height: 36px; border-radius: 10px; font-size: 18px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
}
.sf-brand-text {
  font-weight: 800; font-size: 18px; color: #fff; letter-spacing: 1px;
}
.brand-accent { color: #818cf8; }
.sf-search {
  flex: 1; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 0 16px;
  transition: all var(--transition);
}
.sf-search:focus-within {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.sf-search i { font-size: 18px; color: rgba(255,255,255,0.4); flex-shrink: 0; }
.sf-search input {
  border: none; background: none; padding: 11px 0; font-size: 14px;
  outline: none; color: #fff; font-family: var(--font); width: 100%;
}
.sf-search input::placeholder { color: rgba(255,255,255,0.35); }
.sf-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.sf-login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 10px; font-size: 13px;
  font-weight: 500; font-family: var(--font); cursor: pointer;
  color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05); transition: all var(--transition);
  white-space: nowrap;
}
.sf-login-btn:hover {
  color: #fff; border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
}
.sf-login-btn i { font-size: 16px; }

/* Company filter chips */
.sf-filters {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 64px; z-index: 40; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.sf-filters-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sf-chip {
  padding: 7px 18px; border-radius: 99px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: none; cursor: pointer;
  color: var(--text-sec); transition: all var(--transition); font-family: var(--font);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.sf-chip i { font-size: 14px; }
.sf-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.sf-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Product content */
.sf-content { max-width: 1280px; margin: 0 auto; padding: 28px 32px 60px; }
#storefront .sf-content { background: transparent; }
#storefront { background: #f1f5f9; }
.sf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.sf-result-count { font-size: 14px; color: var(--text-sec); font-weight: 500; }
.sf-items-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

/* Storefront product cards */
.sf-product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
}
.sf-product-card:hover {
  border-color: var(--accent); box-shadow: 0 8px 30px rgba(99,102,241,0.12), 0 0 0 1px rgba(99,102,241,0.15);
  transform: translateY(-2px);
}
.sf-card-img {
  height: 160px; background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.sf-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-card-img .placeholder-icon { font-size: 36px; color: #cbd5e1; }
.sf-card-company {
  position: absolute; bottom: 10px; left: 10px;
  font-size: 11px; background: rgba(15,23,42,0.75); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-weight: 500;
  backdrop-filter: blur(4px); display: flex; align-items: center; gap: 4px;
}
.sf-card-company i { font-size: 12px; opacity: 0.7; }
.sf-card-body { padding: 16px 18px; flex: 1; }
.sf-card-company-sub {
  font-size: 12px; color: var(--text-sec); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  margin: -6px 0 10px;
}
.sf-card-company-sub i { font-size: 13px; color: var(--accent); }
.sf-card-name {
  font-weight: 600; font-size: 15px; color: var(--text);
  margin-bottom: 12px; line-height: 1.4;
}
.sf-card-features { list-style: none; }
.sf-card-features li {
  font-size: 13px; color: var(--text-sec); padding: 5px 0;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.sf-card-features li:last-child { border-bottom: none; }
.sf-card-features li i { font-size: 14px; color: var(--accent); width: 18px; text-align: center; flex-shrink: 0; }
.sf-card-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: #fafbfc;
}
.sf-card-footer .sf-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 8px; font-weight: 500; font-size: 12px;
  border: 1px solid var(--border); background: none; color: var(--text-sec);
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.sf-card-footer .sf-copy-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.sf-card-footer .sf-copy-btn.copied { background: var(--success-light); color: var(--success); border-color: var(--success); }
.sf-card-footer .img-count { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* Empty state */
.sf-empty { text-align: center; padding: 80px 20px; }
.sf-empty-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: #f1f5f9; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 24px; font-size: 36px; color: #94a3b8;
}
.sf-empty-title { font-weight: 600; font-size: 20px; margin-bottom: 8px; color: var(--text); }
.sf-empty-desc { font-size: 15px; color: var(--text-sec); }

/* Footer */
.sf-footer {
  background: var(--bg-sidebar); padding: 20px 32px;
}
.sf-footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.sf-footer-brand {
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.sf-footer-brand i { color: #818cf8; font-size: 16px; }
.sf-footer-text { color: #64748b; font-size: 12px; }

/* Storefront view button */
.sf-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 8px; font-weight: 500; font-size: 13px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  transition: all var(--transition);
}
.sf-view-btn:hover { background: var(--accent-hover); }

/* Media count badge on card image */
.media-count {
  position: absolute; top: 8px; right: 8px; font-size: 11px;
  background: rgba(15,23,42,0.75); color: #fff; padding: 3px 8px;
  border-radius: 6px; display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px); font-weight: 500;
}
.media-count i { font-size: 13px; }

/* Video badge on thumbnails */
.thumb-vid-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; pointer-events: none;
}
.thumb { position: relative; }

/* Public product detail gallery */
.sf-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.sf-gallery-item { position: relative; border-radius: 8px; overflow: hidden; }
.sf-gallery-item img, .sf-gallery-item video { display: block; }
.dl-btn {
  position: absolute; bottom: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; text-decoration: none;
  transition: background 0.2s; backdrop-filter: blur(4px);
}
.dl-btn:hover { background: var(--accent); }
.sf-detail-sec { margin-bottom: 16px; }
.sf-detail-label { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text); }

/* ========== VIDEO COMPRESS OVERLAY ========== */
.compress-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; backdrop-filter: blur(6px);
}
.compress-box {
  background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 36px 40px; text-align: center; width: 340px;
  box-shadow: var(--shadow-lg);
}
.compress-box > i { font-size: 36px; color: var(--accent); margin-bottom: 12px; display: block; }
.compress-title { font-weight: 600; font-size: 16px; margin-bottom: 16px; }
.compress-bar {
  height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}
.compress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: 99px; transition: width 0.3s ease;
}
.compress-pct { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.compress-hint { font-size: 12px; color: var(--text-muted); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-stats { grid-template-columns: repeat(3, 1fr); }
  .search-box { width: 200px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu { display: flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-header { flex-wrap: wrap; }
  .detail-actions { width: 100%; margin-top: 12px; }
  .search-box { width: 160px; }
  .btn-label { display: none; }
  .items-grid { grid-template-columns: 1fr; }

  .sf-header-inner { padding: 0 16px; gap: 12px; }
  .sf-search { max-width: none; }
  .sf-login-btn .btn-label { display: none; }
  .sf-content { padding: 20px 16px 40px; }
  .sf-items-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .sf-items-grid { grid-template-columns: 1fr; }
  .sf-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .status-radio-4 .status-opt { flex: 1 1 100%; }
  .cred-grid { grid-template-columns: 1fr !important; }
}

/* ===================================================================
   SMART ADMIN: autocomplete, credentials, status, view modal
   =================================================================== */

/* Company autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; left: 0; right: 0; top: calc(100% - 14px); z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; margin-top: 2px;
}
.ac-item {
  padding: 10px 14px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: background var(--transition);
}
.ac-item:hover { background: var(--accent-light); }
.ac-item i { font-size: 15px; color: var(--text-muted); }
.ac-count { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 8px; border-radius: 99px; }
.ac-new { color: var(--accent); font-weight: 500; border-top: 1px solid var(--border); }
.ac-new i { color: var(--accent); }

/* Credentials section in item modal */
.cred-section {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 16px; background: #fcfcfd;
}
.cred-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  margin-bottom: 14px; color: var(--text);
}
.cred-head i { color: var(--accent); }
.cred-badge {
  margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent-text); background: var(--accent-light);
  padding: 2px 8px; border-radius: 99px;
}
.cred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cred-section .fg { margin-bottom: 12px; }

.cred-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  font-size: 11px; font-weight: 500; color: var(--accent-text);
  background: var(--accent-light); padding: 3px 10px; border-radius: 99px;
}

/* Admin card footer with status select */
.item-footer-admin { gap: 8px; }
.status-select {
  flex: 1; padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: 12px; font-weight: 600;
  font-family: var(--font); cursor: pointer; background: #fff; color: var(--text);
  outline: none; min-width: 0;
}
.status-select.status-available { color: var(--success-text); border-color: #a7f3d0; background: var(--success-light); }
.status-select.status-pending { color: #b45309; border-color: #fde68a; background: var(--warning-light); }
.status-select.status-review { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
.status-select.status-sold { color: #475569; border-color: #e2e8f0; background: #f1f5f9; }

/* View modal */
.view-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.view-company { font-size: 13px; color: var(--text-sec); display: flex; align-items: center; gap: 5px; }
.view-sec-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px;
}
.view-feats li { font-size: 13px; }
.cred-box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cred-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.cred-row:last-child { border-bottom: none; }
.cred-label { color: var(--text-sec); min-width: 150px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cred-label i { font-size: 15px; color: var(--text-muted); }
.cred-val { flex: 1; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; word-break: break-all; color: var(--text); }
.copy-mini {
  border: 1px solid var(--border); background: #fff; color: var(--text-sec);
  border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--font);
  transition: all var(--transition); flex-shrink: 0;
}
.copy-mini:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.copy-all-creds { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.notes-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--text-sec); white-space: pre-wrap; }
.muted { color: var(--text-muted); }

/* Search page */
.search-subhead {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.search-subhead i { color: var(--accent); }

/* Admin item card placeholder */
.item-img .placeholder-icon { font-size: 30px; color: #cbd5e1; }
.item-img { background: linear-gradient(135deg, #f8fafc, #eef2f7); }
