/* ============================================================
   FINDBACK — Professional Design System
   SaaS Aesthetic (Vercel / Linear / Shadcn inspired)
   ============================================================ */

/* ---- Design Tokens ---- */
:root {
  /* Nuanced gray scale (Zinc/Neutral inspired) */
  --bg:           #fafafa;
  --surface-1:    #ffffff;
  --surface-2:    #f4f4f5;
  --surface-3:    #e4e4e7;
  --surface-hover:#f4f4f5;

  --border:       #e4e4e7;
  --border-bright:#a1a1aa;
  
  --glare:        rgba(255, 255, 255, 0);

  /* Primary brand scale (Blue) */
  --primary:      #09090b; /* Pure dark / black primary */
  --primary-dark: #000000;
  --primary-light:#27272a;
  --primary-glow: rgba(9, 9, 11, 0.05);

  --accent:       #2563eb;
  --accent-light: #eff6ff;
  --accent-glow:  rgba(37, 99, 235, 0.1);

  --cyan:         #0ea5e9;
  --cyan-glow:    rgba(14, 165, 233, 0.1);

  /* Status */
  --success:      #10b981;
  --success-bg:   rgba(16, 185, 129, 0.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245, 158, 11, 0.1);
  --danger:       #ef4444;
  --danger-bg:    rgba(239, 68, 68, 0.1);

  /* Text */
  --text:         #09090b;
  --text-muted:   #71717a;
  --text-dim:     #a1a1aa;

  --sidebar-w:    240px;
  
  /* Very tight, professional border radiuses */
  --radius:       8px;
  --radius-sm:    6px;
  --radius-xs:    4px;

  /* Extremely crisp, subtle shadows */
  --shadow-sm:    0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow:       0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow-lg:    0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);

  --t:  .15s ease-out;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* ---- Reset & Base ---- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button{cursor:pointer;font-family:var(--font); outline: none;}
input,textarea,select{font-family:var(--font); outline: none;}

/* Global Layout Animation */
#app { transition: margin-left var(--t); min-height: 100vh; }

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
#sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform var(--t);
}
#sidebar.sidebar--open { transform: translateX(0); }

@media (min-width: 769px) {
  body.sidebar-open #app { margin-left: var(--sidebar-w); }
}

/* Sidebar logo */
.sidebar-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 24px; height: 24px; border-radius: 4px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0; color: #fff;
}
.sidebar-logo-text { font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1; padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: .75rem; font-weight: 500; color: var(--text-dim);
  padding: 12px 8px 4px; margin-top: 8px;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  border: none; background: transparent; width: 100%; text-align: left;
  transition: background var(--t), color var(--t);
}
.sidebar-nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav-item .nav-icon { font-size: 1rem; flex-shrink: 0; line-height: 1; width: 16px; text-align: center;}
.sidebar-nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 500; }

/* Sidebar footer */
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  transition: background var(--t); cursor: pointer;
}
.sidebar-user:hover { background: var(--surface-2); }
.sidebar-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-xs);
  background: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: .8rem; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: .85rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .75rem; color: var(--text-muted); text-transform: capitalize; }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px; justify-content: flex-start;
  padding: 8px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 500; color: var(--danger);
  border: 1px solid transparent; background: transparent; width: 100%;
  transition: background var(--t);
}
.sidebar-logout:hover { background: var(--danger-bg); }

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page-container {
  max-width: 1080px; margin: 0 auto;
  padding: 32px;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}
.page-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; color: var(--text); line-height: 1.2; }
.page-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* ============================================================
   BUTTONS (SaaS Monolithic)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; border: 1px solid transparent;
  transition: all var(--t); white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(.98); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-light); }

.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-hover); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-outline:hover { background: var(--surface-hover); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: #dc2626; }

.btn-print { background: var(--accent-light); color: var(--accent); border: 1px solid #bfdbfe; box-shadow: none; }
.btn-print:hover { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 10px 20px; font-size: .95rem; border-radius: var(--radius); }
.btn-xl { padding: 12px 24px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* ============================================================
   CARDS & GRIDS (Clean White borders)
   ============================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; background: var(--surface-2); color: var(--text-muted);
}
.stat-icon.indigo { color: #4f46e5; }
.stat-icon.sky    { color: #0284c7; }
.stat-icon.amber  { color: #d97706; }
.stat-icon.green  { color: #059669; }
.stat-icon.red    { color: #dc2626; }
.stat-icon.purple { color: #7c3aed; }

.stat-body { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 600; letter-spacing: -.03em; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   ITEM CARDS
   ============================================================ */
.item-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color var(--t); cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.item-card:hover { border-color: var(--border-bright); }
.item-card-img { width: 100%; height: 180px; object-fit: cover; background: #f4f4f5; border-bottom: 1px solid var(--border); }
.item-card-img-placeholder {
  width: 100%; height: 180px; background: #f4f4f5; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #d4d4d8;
}
.item-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.item-card-title { font-weight: 600; font-size: .95rem; margin-bottom: 8px; color: var(--text); }
.item-card-meta { font-size: .8rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; }
.item-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}

/* ============================================================
   BADGES (Flat colors)
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-xs);
  font-size: .7rem; font-weight: 500; white-space: nowrap;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.badge-pending      { background: #fefce8; color: #b45309; border-color: #fef08a; }
.badge-available    { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-matched      { background: #f0f9ff; color: #0284c7; border-color: #bae6fd; }
.badge-approved     { background: #f4f4f5; color: #18181b; border-color: #e4e4e7; }
.badge-rejected     { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-released     { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge-claimed      { background: #faf5ff; color: #6d28d9; border-color: #e9d5ff; }
.badge-archived     { background: #fafafa; color: #71717a; border-color: #e4e4e7; }
.badge-under_review { background: #fefce8; color: #b45309; border-color: #fef08a; }

.role-badge { padding: 2px 8px; border-radius: var(--radius-xs); font-size: .65rem; font-weight: 500; text-transform: uppercase; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 500; color: var(--text); }
.form-control {
  width: 100%; padding: 8px 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .875rem; transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-sm);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-error { color: #dc2626; font-size: .8rem; margin-top: 6px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; text-align: left; }
thead { background: var(--bg); border-bottom: 1px solid var(--border); }
th { padding: 12px 16px; font-weight: 500; color: var(--text-muted); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ============================================================
   PROFILE ENHANCEMENTS
   ============================================================ */
.profile-cover {
  height: 160px;
  background: linear-gradient(135deg, #09090b 0%, #27272a 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
}
.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.05) 1px, transparent 0);
  background-size: 24px 24px;
}

.profile-header-content {
  margin-top: -60px;
  padding: 0 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--surface-1);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-wrapper .avatar-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--t);
  cursor: pointer;
}

.profile-avatar-wrapper:hover .avatar-edit-overlay {
  opacity: 1;
}

.profile-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.profile-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.profile-main-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all var(--t);
}

.profile-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

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

/* Sidebar Profile Dropdown */
.profile-dropdown {
  position: absolute;
  bottom: 80px;
  left: 12px;
  right: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 8px;
  z-index: 1000;
  animation: slideUp 0.2s ease-out;
}

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

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all var(--t);
  cursor: pointer;
}

.profile-dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.profile-dropdown-item.danger {
  color: var(--danger);
}

.profile-dropdown-item.danger:hover {
  background: var(--danger-bg);
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

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

@media (max-width: 768px) {
  .profile-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -50px;
  }
  .profile-main-grid {
    grid-template-columns: 1fr;
  }
  .profile-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .profile-nav-item {
    white-space: nowrap;
    width: auto;
  }
}


/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto; padding: 24px; position: relative;
  box-shadow: var(--shadow-lg); animation: fadeScale .15s ease-out;
}
@keyframes fadeScale { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.modal-box.modal-lg { max-width: 700px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; color: var(--text-muted); width: 28px; height: 28px;
  border-radius: var(--radius-sm); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; border: none; transition: background var(--t);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 16px; color: var(--text); }

/* ============================================================
   TOAST (Premium SaaS Style)
   ============================================================ */
#toast-container { 
  position: fixed; 
  bottom: 24px; 
  right: 24px; 
  z-index: 9999; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 12px 16px; 
  border-radius: var(--radius);
  background: #fff; 
  border: 1px solid var(--border);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 300px; 
  max-width: 420px;
  animation: toastIn .3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.toast-out { 
  animation: toastOut .3s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; display: flex; align-items: center; }
.toast-msg { font-size: .875rem; flex: 1; font-weight: 500; color: var(--text); line-height: 1.4; }
.toast-close { 
  background: transparent; 
  border: none; 
  color: var(--text-dim); 
  cursor: pointer; 
  padding: 4px; 
  border-radius: 4px; 
  font-size: 0.9rem;
  transition: all var(--t);
}
.toast-close:hover { background: var(--surface-2); color: var(--text); }

/* Toast Variants */
.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left: 4px solid var(--accent); }
.toast-info .toast-icon { color: var(--accent); }

@keyframes toastIn { 
  from { transform: translateX(100%); opacity: 0; } 
  to { transform: translateX(0); opacity: 1; } 
}
@keyframes toastOut { 
  from { transform: translateX(0); opacity: 1; } 
  to { transform: translateX(100%); opacity: 0; } 
}

/* ============================================================
   LANDING PAGE (Classic Pro)
   ============================================================ */
.landing { min-height: 100vh; position: relative; background: #fff; }

/* Public header */
.pub-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.pub-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.pub-logo-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pub-logo-icon { width: 24px; height: 24px; background: var(--primary); border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: .8rem; color: #fff; }
.pub-logo-text { font-size: 1.05rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; }
.pub-header-actions { display: flex; align-items: center; gap: 12px; }

/* Hero */
.hero {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  padding: 140px 32px 80px; position: relative; text-align: center;
}
.hero-content { max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 99px; margin-bottom: 24px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .75rem; font-weight: 500;
}
.hero-badge:hover { border-color: var(--border-bright); color: var(--text); }
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 700;
  line-height: 1.05; letter-spacing: -.03em; margin-bottom: 24px; color: var(--text);
}
.hero-desc { font-size: 1.15rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; line-height: 1.6; }
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 64px; }

.hero-stats { display: flex; align-items: center; justify-content: center; gap: 32px; flex-wrap: wrap; padding-top: 40px; border-top: 1px solid var(--border); max-width: 600px; margin: 0 auto; }
.hero-stat { text-align: center; }
.hero-stat-val { display: block; font-size: 1.8rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; line-height: 1; }
.hero-stat-lbl { font-size: .75rem; color: var(--text-muted); margin-top: 4px; display: block; font-weight: 500; }

/* Features */
.features-section { padding: 100px 32px; background: var(--bg); border-top: 1px solid var(--border); }
.section-container { max-width: 1080px; margin: 0 auto; }
.section-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; display: block; text-transform: uppercase; letter-spacing: .05em; }
.section-heading { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: 48px; color: var(--text); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 24px; }
.feature-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 32px;
  box-shadow: var(--shadow-sm);
}
.feature-card h3 { font-size: 1rem; font-weight: 600; margin: 12px 0 8px; color: var(--text); }
.feature-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }
.feature-icon-wrap { width: 32px; height: 32px; font-size: 1.4rem; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--radius-sm); }

/* How it works */
.how-section { padding: 100px 32px; background: #fff; border-top: 1px solid var(--border); }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 32px; }
.step-card { padding: 32px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.step-number { font-size: 2rem; font-weight: 500; color: var(--text-dim); margin-bottom: 12px; line-height: 1; }
.step-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.step-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* CTA band */
.cta-section {
  padding: 80px 32px; border-top: 1px solid var(--border); background: var(--bg); text-align: center;
}
.cta-section h2 { font-size: 2rem; font-weight: 600; margin-bottom: 12px; color: var(--text); letter-spacing: -.02em;}
.cta-section p { color: var(--text-muted); margin-bottom: 32px; font-size: 1rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* Footer */
.pub-footer { padding: 32px; background: #fff; border-top: 1px solid var(--border); }
.pub-footer-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.pub-footer-copy { font-size: .8rem; color: var(--text-muted); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0ea5e9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text-light {
  background: linear-gradient(135deg, #93c5fd 0%, #c4b5fd 50%, #67e8f9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-layout {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); padding: 32px;
}
.auth-layout--split {
  flex-direction: row; align-items: stretch; padding: 0; background: #fff;
}

/* Brand panel (left) */
.auth-panel-brand {
  display: none;
  position: relative; flex: 1; overflow: hidden;
  background: #09090b; color: #fff;
}
.auth-layout--split .auth-panel-brand { display: flex; }
.auth-brand-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(37, 99, 235, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(124, 58, 237, 0.25) 0%, transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
}
.auth-brand-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 28px 28px;
}
.auth-brand-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 56px; max-width: 520px; margin: 0 auto; height: 100%;
}
.auth-brand-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 40px;
}
.auth-brand-logo .logo-icon {
  width: 32px; height: 32px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: .9rem; color: #fff;
}
.auth-brand-logo span { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; }
.auth-brand-headline {
  font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 700;
  line-height: 1.15; letter-spacing: -.03em; margin-bottom: 16px;
}
.auth-brand-sub {
  font-size: .95rem; color: rgba(255,255,255,0.6); line-height: 1.65; margin-bottom: 36px;
}
.auth-brand-features { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
.auth-brand-feat {
  display: flex; align-items: flex-start; gap: 14px;
  font-size: .875rem; color: rgba(255,255,255,0.75);
}
.auth-brand-feat strong {
  display: block; color: #fff; font-weight: 500; font-size: .875rem; margin-bottom: 2px;
}
.auth-brand-feat span { font-size: .8rem; color: rgba(255,255,255,0.5); line-height: 1.4; }
.auth-brand-feat-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center; color: #93c5fd;
}
.auth-brand-feat-icon .lucide { width: 18px; height: 18px; }
.auth-brand-stats {
  display: flex; align-items: center; gap: 24px; padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.auth-brand-stat-val { display: block; font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.auth-brand-stat-lbl { font-size: .7rem; color: rgba(255,255,255,0.45); margin-top: 4px; display: block; font-weight: 500; }
.auth-brand-stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.12); flex-shrink: 0; }

/* Form panel (right) */
.auth-panel-form {
  width: 100%; max-width: 380px;
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.auth-layout--split .auth-panel-form {
  flex: 0 0 480px; max-width: none; background: var(--bg);
  border-left: 1px solid var(--border);
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; margin-bottom: 24px;
  font-size: .85rem; font-weight: 500; color: var(--text-muted);
  transition: color var(--t);
}
.auth-back-link:hover { color: var(--text); }
.auth-back-link .lucide { width: 16px; height: 16px; }

.auth-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; box-shadow: var(--shadow);
}
.auth-card-header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px;
}
.auth-card-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.auth-card-icon .lucide { width: 20px; height: 20px; }
.auth-card-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 4px; color: var(--text); letter-spacing: -.02em; }
.auth-card-sub { color: var(--text-muted); font-size: .875rem; margin-bottom: 24px; }
.auth-card-header .auth-card-sub { margin-bottom: 0; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none; display: flex;
}
.input-icon-wrap .input-icon .lucide { width: 16px; height: 16px; }
.input-with-icon { padding-left: 38px; padding-right: 38px; }
.input-toggle-pass {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 6px 8px;
  color: var(--text-dim); border-radius: var(--radius-xs);
  transition: color var(--t), background var(--t);
}
.input-toggle-pass:hover { color: var(--text); background: var(--surface-2); }
.input-toggle-pass .lucide { width: 16px; height: 16px; }

.auth-alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin-bottom: 16px;
  background: var(--danger-bg); border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm); color: #b91c1c;
  font-size: .85rem; line-height: 1.4;
}
.auth-alert.hidden { display: none; }

.auth-submit { gap: 8px; margin-top: 4px; }
.auth-submit-icon { width: 16px; height: 16px; transition: transform var(--t); }
.auth-submit:hover:not(:disabled) .auth-submit-icon { transform: translateX(2px); }
.auth-submit:disabled .auth-submit-icon { display: none; }

.auth-divider {
  text-align: center; color: var(--text-muted); font-size: .75rem;
  margin: 20px 0; display: flex; align-items: center;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { padding: 0 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.auth-footer { margin-top: 24px; text-align: center; font-size: .85rem; color: var(--text-muted); }
.auth-footer a { color: var(--text); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--border); transition: border-color var(--t); }
.auth-footer a:hover { border-color: var(--text); }

/* In-auth Logo (register / legacy) */
.auth-logo-center { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 32px; }
.auth-logo-center .logo-icon { width: 24px; height: 24px; background: var(--primary); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: #fff; }
.auth-logo-center span { font-weight: 600; font-size: 1rem; color: var(--text); letter-spacing: -.02em; }

/* ============================================================
   PUBLIC BROWSE
   ============================================================ */
.browse-topbar {
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 80;
}
.browse-topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
}
.filter-bar .form-control { flex: 1; min-width: 180px; max-width: 250px; }
.search-icon-wrap { position: relative; flex: 1; min-width: 180px; max-width: 250px; }
.search-icon-wrap .form-control { padding-left: 36px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: .9rem; }

/* ============================================================
   SECTIONS, SPINNER, EMPTY STATE
   ============================================================ */
.section-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 20px; color: var(--text); letter-spacing: -.01em; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); background: var(--bg); border-radius: var(--radius); border: 1px dashed var(--border-bright); }
.empty-state-icon { font-size: 2rem; margin-bottom: 16px; color: var(--text-dim); }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: .875rem; }

.spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 64px; }
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.img-upload-box {
  border: 1px dashed var(--border-bright); border-radius: var(--radius-sm);
  padding: 32px; text-align: center; cursor: pointer; background: var(--bg);
  transition: background var(--t); font-size: .875rem; color: var(--text-muted);
}
.img-upload-box:hover { background: var(--surface-2); }
.img-upload-box input { display: none; }
.img-preview { max-height: 160px; border-radius: var(--radius-sm); margin: 16px auto 0; border: 1px solid var(--border); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.detail-row { padding: 12px 0; border-bottom: 1px solid var(--bg); display: flex; justify-content: space-between;}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: .875rem; color: var(--text-muted); }
.detail-value { font-size: .875rem; font-weight: 500; color: var(--text); text-align: right; }

.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 0; font-size: .875rem; font-weight: 500; color: var(--text-muted); border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t); cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab:hover:not(.active) { color: var(--text); }

.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  min-width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff;
  color: var(--text-muted); font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; transition: all var(--t);
}
.page-btn:hover:not(:disabled),.page-btn.active { background: var(--surface-2); color: var(--text); }
.page-btn:disabled { opacity: .5; pointer-events: none; }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hidden { display: none !important; }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* SVG Icons */
.lucide { width: 1em; height: 1em; vertical-align: middle; stroke-width: 2; display: inline-block; }
.btn .lucide { width: 1.15em; height: 1.15em; margin-top:-2px;}
.stat-icon .lucide { width: 24px; height: 24px; stroke-width: 2; }
.feature-icon-wrap .lucide { width: 24px; height: 24px; }
.search-icon-wrap .lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 100%; }
  #sidebar { left: 0; right: 0; top: 0; bottom: 0; width: 100%; border-radius: 0; transform: translateX(-100%); }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.5rem; }
  .hero-stats { gap: 16px; flex-direction: column; }
  .page-container { padding: 24px 16px 64px; }
  .detail-row { flex-direction: column; align-items: flex-start; }
  .detail-value { text-align: left; margin-top: 2px; }

  /* Auth — stack on mobile */
  .auth-layout--split { flex-direction: column; }
  .auth-layout--split .auth-panel-brand { flex: none; min-height: auto; }
  .auth-brand-content { padding: 32px 24px; max-width: none; }
  .auth-brand-headline { font-size: 1.5rem; }
  .auth-brand-features { margin-bottom: 24px; }
  .auth-brand-stats { display: none; }
  .auth-layout--split .auth-panel-form {
    flex: 1; border-left: none; border-top: 1px solid var(--border); padding: 24px 16px 40px;
  }
}
