/* =========================================
   SBC PROFILE PLATFORM – Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────── */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #20558a;
  --primary-bg: #eef2ff;

  --accent: #06b6d4;
  --accent-light: #67e8f9;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-focus: #6366f1;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-primary: 0 8px 24px rgba(99,102,241,.30);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-w: 250px;
  --header-h: 64px;
  --transition: .2s cubic-bezier(.4,0,.2,1);

  --font: 'Inter', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────── */
*, *::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-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); border: none; }
input, textarea, select { font-family: var(--font); }
ul { list-style: none; }

/* ── Typography ────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-secondary); }

/* ── Utility ───────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.25rem; border-radius: var(--radius-sm); border: none;
  font-weight: 600; font-size: .875rem; cursor: pointer; transition: var(--transition);
  text-decoration: none; font-family: inherit; min-height: 44px;
}
.btn-primary  { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--primary-bg); color: var(--primary); }
.btn-secondary:hover { background: #e0e7ff; }
.btn-danger { background: #fef2f2; color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-ghost  { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }
.btn-sm   { padding: .4rem .875rem; font-size: .8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ── Form Elements ─────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--text-primary); }
.form-control {
  width: 100%; padding: .625rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #f9fafb; color: var(--text-primary);
  font-family: inherit; font-size: .875rem; transition: var(--transition);
  min-height: 44px; outline: none;
}
.form-control:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; display: block; }

/* ── Card ──────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body  { padding: 1.5rem; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

/* ── Badge ─────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .625rem; border-radius: var(--radius-full); font-size: .75rem; font-weight: 600; }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }

/* ── Toast ─────────────────────────────── */
#toast-container {
  position: fixed; top: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .875rem 1.25rem; font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; gap: .625rem;
  animation: slideInRight .3s ease forwards;
  min-width: 260px; max-width: 340px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }
.toast-icon    { font-size: 1.1rem; }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   MODALS & OVERLAYS (Responsive & Sticky Footers)
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; opacity: 0; animation: fadeIn .2s forwards ease;
}
.modal {
  background: var(--bg-card); width: 100%; max-width: 440px;
  border-radius: var(--radius-lg); overflow: hidden; transform: scale(.95);
  animation: scaleUp .2s forwards ease; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); z-index: 2;
}
.modal-title  { font-size: 1.05rem; font-weight: 700; }
.modal-body {
  padding: 1.25rem; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch;
}
.modal-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  background: var(--bg-card); position: sticky; bottom: 0; z-index: 10;
  display: flex; justify-content: flex-end; gap: .75rem;
}
.modal-close  { background: none; font-size: 1.4rem; color: var(--text-muted); line-height: 1; transition: var(--transition); }
.modal-close:hover { color: var(--text-primary); }

@keyframes fadeIn  { from { opacity: 0; }           to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

/* ============================================
   LANDING PAGE
   ============================================ */
.landing-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex; flex-direction: column;
}
.landing-nav {
  padding: 1.25rem 2rem; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.landing-logo { display: flex; align-items: center; gap: .625rem; font-size: 1.25rem; font-weight: 800; color: #fff; }
.landing-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.landing-nav-actions { display: flex; gap: .75rem; align-items: center; }
.btn-outline-white {
  border: 1.5px solid rgba(255,255,255,.3); color: #fff;
  background: transparent; padding: .5rem 1.1rem;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; transition: var(--transition);
}
.btn-outline-white:hover { background: rgba(255,255,255,.08); }
.landing-hero {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 5rem 1.5rem 4rem;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99,102,241,.25) 0%, transparent 70%);
}
.landing-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(99,102,241,.2); border: 1px solid rgba(99,102,241,.4);
  color: var(--primary-light); padding: .35rem 1rem;
  border-radius: var(--radius-full); font-size: .8rem; font-weight: 600; margin-bottom: 1.5rem;
}
.landing-hero h1 { color: #fff; margin-bottom: 1.25rem; }
.landing-hero h1 span { color: var(--primary-light); }
.landing-hero p { color: rgba(255,255,255,.65); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2.5rem; }
.landing-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn-white {
  background: #fff; color: var(--primary-dark); padding: .75rem 1.75rem;
  border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); transition: var(--transition);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.landing-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; padding: 3rem 2rem 4rem; max-width: 1100px; margin: 0 auto; width: 100%;
}
.feature-card {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg); padding: 1.75rem; transition: var(--transition);
}
.feature-card:hover { background: rgba(255,255,255,.08); transform: translateY(-3px); }
.feature-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; margin-bottom: 1rem;
}
.feature-card h3 { color: #fff; margin-bottom: .4rem; font-size: .95rem; }
.feature-card p  { color: rgba(255,255,255,.55); font-size: .85rem; }

.landing-pricing {
  max-width: 1100px; margin: 0 auto; padding: 4rem 2rem; width: 100%;
}
.pricing-header { text-align: center; margin-bottom: 3rem; color: #fff; }
.pricing-header h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.pricing-header p { color: rgba(255,255,255,.6); font-size: 1.1rem; }
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem; align-items: stretch;
}
.pricing-card {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg); padding: 2.5rem 2rem;
  display: flex; flex-direction: column; position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.pricing-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.2); }
.pricing-card.popular {
  background: rgba(99,102,241,.08);
  border-color: var(--primary);
  box-shadow: 0 10px 40px -10px rgba(79,70,229,.3);
}
.popular-badge {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.5px;
}
.plan-name { font-size: 1.25rem; font-weight: 600; color: #fff; margin-bottom: 0.5rem; }
.plan-price { font-size: 2.5rem; font-weight: 800; color: #fff; margin-bottom: 1.5rem; }
.plan-price span { font-size: 1rem; color: rgba(255,255,255,.5); font-weight: 500; }
.plan-features { list-style: none; padding: 0; margin: 0 0 2rem 0; flex: 1; }
.plan-features li {
  display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem;
  color: rgba(255,255,255,.8); font-size: 0.95rem; line-height: 1.4;
}
.plan-features li .chk { color: #10b981; font-weight: bold; }
.plan-features li.disabled { color: rgba(255,255,255,.3); }
.plan-features li.disabled .chk { color: rgba(255,255,255,.2); }

.landing-footer {
  border-top: 1px solid rgba(255,255,255,.08); padding: 1.5rem 2rem;
  text-align: center; color: rgba(255,255,255,.35); font-size: .8rem;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dash-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  flex-shrink: 0; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100; transition: transform var(--transition); overflow-y: auto;
}
.sidebar-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .625rem;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.sidebar-logo-text { font-size: .9rem; font-weight: 700; color: #fff; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.nav-section-title {
  padding: .5rem 1.5rem .3rem;
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
}
.nav-item {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1.5rem;
  color: rgba(255,255,255,.6); font-size: .875rem; font-weight: 500;
  transition: var(--transition); cursor: pointer; border: none;
  background: none; width: 100%; text-decoration: none;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active { background: rgba(99,102,241,.2); color: var(--primary-light); border-right: 3px solid var(--primary); }
.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user {
  display: flex; align-items: center; gap: .75rem; padding: .625rem;
  border-radius: var(--radius-sm); background: rgba(255,255,255,.05);
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; flex-shrink: 0; overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.4); }

.dash-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dash-header {
  height: var(--header-h); background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.dash-header-left { display: flex; align-items: center; gap: 1rem; }
.page-title { font-size: 1.05rem; font-weight: 700; }
.page-breadcrumb { font-size: .8rem; color: var(--text-muted); }
.dash-header-right { display: flex; align-items: center; gap: .75rem; }
.current-plan-badge {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.2);
  color: var(--primary); padding: .35rem .8rem;
  border-radius: var(--radius-full); font-size: .75rem; font-weight: 500;
}
.current-plan-badge strong { color: var(--primary-dark); font-weight: 700; }
.limit-upgrade-msg {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .85rem;
  display: flex; align-items: center; gap: .5rem; font-weight: 500;
}
.limit-upgrade-msg a { color: #b45309; text-decoration: underline; font-weight: 700; }
.mobile-menu-btn { display: none; background: none; padding: .4rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 1.25rem; }
.dash-content { padding: 1.75rem; flex: 1; }
.profile-preview-link {
  display: flex; align-items: center; gap: .5rem;
  background: var(--primary-bg); color: var(--primary);
  padding: .4rem .875rem; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600; transition: var(--transition);
}
.profile-preview-link:hover { background: #e0e7ff; }
.dash-section { display: none; }
.dash-section.active { display: block; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.section-title-group h2 { font-size: 1.3rem; margin-bottom: .2rem; }
.section-title-group p  { font-size: .85rem; color: var(--text-muted); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); transition: var(--transition); }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: .875rem; }
.stat-icon.purple { background: var(--primary-bg); }
.stat-icon.cyan   { background: #ecfeff; }
.stat-icon.green  { background: #d1fae5; }
.stat-icon.orange { background: #fff7ed; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin-bottom: .2rem; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* Item list */
.item-list { display: flex; flex-direction: column; gap: .75rem; }
.item-row {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.item-row:hover { box-shadow: var(--shadow); }
.item-row-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--primary-bg); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.item-row-info { flex: 1; min-width: 0; }
.item-row-title { font-weight: 600; font-size: .9rem; margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row-sub   { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* Product cards */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.product-card-dash { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.product-card-dash:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-img { height: 140px; background: linear-gradient(135deg, #e0e7ff, #f0f9ff); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; overflow: hidden; position: relative; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.product-card-body { padding: 1rem; }
.product-card-title { font-weight: 700; margin-bottom: .3rem; font-size: .9rem; }
.product-card-desc  { font-size: .78rem; color: var(--text-muted); margin-bottom: .625rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { font-size: 1rem; font-weight: 800; color: var(--primary); margin-bottom: .75rem; }
.product-card-actions { display: flex; gap: .5rem; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .875rem; }
.gallery-item { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; position: relative; cursor: pointer; background: var(--primary-bg); border: 2px solid var(--border); transition: var(--transition); }
.gallery-item:hover { border-color: var(--primary); transform: scale(1.02); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; gap: .5rem; opacity: 0; transition: var(--transition); }
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* Upload zone */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 2.5rem; text-align: center; cursor: pointer; transition: var(--transition); background: var(--bg); }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone .upload-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.upload-zone p { color: var(--text-muted); font-size: .875rem; }
.upload-zone strong { color: var(--primary); }

/* Avatar / Cover preview */
.avatar-upload-wrap { display: flex; align-items: center; gap: 1.25rem; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-bg), #e0e7ff); border: 3px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; position: relative; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cover-preview { width: 100%; height: 120px; border-radius: var(--radius); background: linear-gradient(135deg, #e0e7ff, #f0f9ff); border: 2px dashed var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 2rem; cursor: pointer; position: relative; transition: var(--transition); }
.cover-preview:hover { border-color: var(--primary); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.cover-preview-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; background: rgba(0,0,0,.25); color: #fff; font-size: .8rem; font-weight: 600; opacity: 0; transition: var(--transition); }
.cover-preview:hover .cover-preview-label { opacity: 1; }

/* Empty state */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3   { color: var(--text-primary); margin-bottom: .4rem; }
.empty-state p    { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.25rem; }

/* Input group */
.input-group { display: flex; }
.input-group-prefix { background: var(--bg); border: 1.5px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); padding: .625rem .875rem; font-size: .9rem; color: var(--text-muted); white-space: nowrap; display: flex; align-items: center; }
.input-group .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ============================================
   PUBLIC PROFILE PAGE
   ============================================ */
.profile-page { min-height: 100vh; background: var(--bg); }
.profile-cover-wrap { position: relative; }
.profile-cover { width: 100%; height: 240px; background: linear-gradient(135deg, var(--primary-dark), var(--accent)); overflow: hidden; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-wrap { position: absolute; bottom: -50px; left: 50%; transform: translateX(-50%); }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; border: 4px solid #fff; box-shadow: var(--shadow-lg); background: linear-gradient(135deg, var(--primary), var(--accent)); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-header { text-align: center; padding: 4rem 1.5rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.profile-name { font-size: 1.6rem; font-weight: 800; margin-bottom: .3rem; }
.profile-bio  { color: var(--text-secondary); font-size: .925rem; max-width: 480px; margin: 0 auto .875rem; }
.profile-meta { display: flex; align-items: center; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-meta-item { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-muted); }

/* Social icons */
.social-icons-row { display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap; padding: 1.5rem; }
.social-icon-btn { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; transition: var(--transition); border: 2px solid var(--border); color: var(--text-primary); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.social-icon-btn:hover { transform: translateY(-3px) scale(1.08); box-shadow: var(--shadow); }
.social-icon-btn.facebook  { border-color: #1877f2; color: #1877f2; }
.social-icon-btn.instagram { border-color: #e1306c; color: #e1306c; }
.social-icon-btn.twitter   { border-color: #1da1f2; color: #1da1f2; }
.social-icon-btn.linkedin  { border-color: #0a66c2; color: #0a66c2; }
.social-icon-btn.tiktok    { border-color: #010101; color: #010101; }
.social-icon-btn.youtube   { border-color: #ff0000; color: #ff0000; }
.social-icon-btn.snapchat  { border-color: #fffc00; color: #f5a623; }
.social-icon-btn.telegram  { border-color: #2ca5e0; color: #2ca5e0; }
.social-icon-btn.whatsapp  { border-color: #25d366; color: #25d366; }

/* Profile sections */
#tab-store, #tab-media { padding-top: 4rem; }
.profile-container { max-width: 780px; margin: 0 auto; padding: 1.5rem 1.25rem 6rem; }
.profile-section { margin-bottom: 2.5rem; }
.profile-section-title { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--border); }

/* Custom link cards */
.custom-link-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; margin-bottom: .75rem; transition: var(--transition); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text-primary); cursor: pointer; }
.custom-link-card:hover { border-color: var(--primary); box-shadow: var(--shadow-primary); transform: translateY(-2px); color: var(--primary); }
.custom-link-icon-wrap { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--primary-bg); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.custom-link-title { font-weight: 700; font-size: .95rem; }
.custom-link-arrow { margin-left: auto; color: var(--text-muted); font-size: 1rem; }

/* Public products */
.pub-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.pub-product-card  { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.pub-product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.pub-product-img   { height: 160px; background: linear-gradient(135deg, #e0e7ff, #f0f9ff); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; overflow: hidden; position: relative; }
.pub-product-img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.pub-product-body  { padding: 1rem; }
.pub-product-title { font-weight: 700; font-size: .925rem; margin-bottom: .3rem; }
.pub-product-desc  { font-size: .78rem; color: var(--text-muted); margin-bottom: .625rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-product-price { font-size: 1.05rem; font-weight: 800; color: var(--primary); margin-bottom: .875rem; }
.pub-product-btn   { width: 100%; padding: .6rem; background: var(--primary); color: #fff; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 600; transition: var(--transition); text-align: center; display: block; }
.pub-product-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Gallery (public) */
.pub-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.pub-gallery-item { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: pointer; position: relative; background: linear-gradient(135deg, #e0e7ff, #f0f9ff); border: 2px solid var(--border); transition: var(--transition); }
.pub-gallery-item:hover { transform: scale(1.04); border-color: var(--primary); }
.pub-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Gallery modal */
.gallery-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.88); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn .2s ease; }
.gallery-modal-content { position: relative; max-width: 85vw; max-height: 85vh; }
.gallery-modal-content img { max-width: 85vw; max-height: 85vh; border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.gallery-modal-close { position: absolute; top: -16px; right: -16px; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--text-primary); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); border: none; cursor: pointer; transition: var(--transition); }
.gallery-modal-close:hover { background: var(--danger); color: #fff; }

/* WhatsApp float */
.whatsapp-float { position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 900; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; box-shadow: 0 4px 20px rgba(37,211,102,.45); text-decoration: none; transition: var(--transition); animation: waFloat 2.5s ease-in-out infinite; }
.whatsapp-float:hover { background: #128c7e; transform: scale(1.12); box-shadow: 0 8px 28px rgba(37,211,102,.5); }
@keyframes waFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Public header */
.pub-header { background: var(--bg-sidebar); padding: .875rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.pub-header-logo { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.pub-header-logo .logo-icon { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: .85rem; }

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99; }
.sidebar-overlay.active { display: block; }

/* ============================================
   AUTH PAGES (login.php / register.php)
   ============================================ */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.auth-wrapper { width: 100%; max-width: 460px; }
.auth-card { background: var(--bg-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 2.5rem; border: 1px solid var(--border); animation: scaleIn .25s ease; }
.auth-logo { display: flex; align-items: center; gap: .625rem; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin-bottom: 1.75rem; }
.auth-logo-icon { width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #fff; }
.auth-header { margin-bottom: 1.5rem; }
.auth-header h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-header p  { font-size: .875rem; color: var(--text-muted); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-submit { margin-top: .5rem; padding: .75rem; font-size: .95rem; }
.auth-alert { border-radius: var(--radius-sm); padding: .875rem 1rem; font-size: .85rem; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.auth-alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.auth-alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-3    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2    { grid-template-columns: 1fr; }
  .grid-3    { grid-template-columns: 1fr; }
  .grid-4    { grid-template-columns: repeat(2, 1fr); }
  .pub-products-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-cover { height: 160px; }
  .profile-name  { font-size: 1.3rem; }
  .landing-features { padding: 2rem 1.25rem 3rem; }
  .landing-hero { padding: 4rem 1.25rem 3rem; }
  .auth-card { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .pub-products-grid { grid-template-columns: 1fr; }
  .pub-gallery-grid  { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid      { grid-template-columns: repeat(3, 1fr); }
  .dash-content { padding: 1rem; }
  .dash-header  { padding: 0 1rem; }
  .products-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
}

/* ================================================
   PROFILE ACTION BUTTONS  (Contact / QR / Share)
   ================================================ */
.pub-header-actions {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.pub-action-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.pub-action-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.5);
  transform: translateY(-1px);
}
.pub-action-icon { font-size: .95rem; line-height: 1; }
@media (max-width: 420px) {
  .pub-action-label { display: none; }
  .pub-action-btn   { padding: .38rem .5rem; }
}

/* Dashboard Profile Actions section */
.contact-checklist { display: flex; flex-direction: column; gap: .6rem; }
.contact-check-item {
  display: flex; align-items: center; gap: .625rem; font-size: .875rem;
  padding: .625rem .875rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.contact-check-item .ck-icon { font-size: 1.05rem; flex-shrink: 0; }
.contact-check-item.ok   { border-color: #6ee7b7; background: #f0fdf4; }
.contact-check-item.warn { border-color: #fcd34d; background: #fffbeb; }
.profile-qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: 1.5rem; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
}

/* ── Bottom Navigation ──────────────────────────────── */
.profile-page {
  padding-bottom: 85px; /* Space for bottom nav */
  padding-bottom: calc(85px + env(safe-area-inset-bottom));
}

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card-bg, #ffffff);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .bnav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.75rem 0.5rem;
  background: transparent; border: none;
  color: var(--text-muted, #6b7280);
  font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  gap: 0.25rem;
}

.bottom-nav .bnav-btn span:first-child {
  font-size: 1.25rem;
  filter: grayscale(100%) opacity(0.6);
  transition: all 0.2s;
}

.bottom-nav .bnav-btn:hover {
  color: var(--text, #111827);
  background: rgba(0,0,0,0.03);
}

.bottom-nav .bnav-btn.active {
  color: var(--button-bg, #4f46e5);
}

.bottom-nav .bnav-btn.active span:first-child {
  filter: grayscale(0%) opacity(1);
  transform: translateY(-2px);
}

/* ── Media Video Embeds ──────────────────────────────── */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

/* ── Cover Action Buttons ────────────────────────────── */
.cover-actions {
  position: absolute;
  top: 1rem; right: 1rem;
  display: flex; gap: 0.5rem;
  z-index: 10;  

}
.pub-action-btn-cover {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: none;
  
  display: flex; align-items: center; justify-content: center;
   cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0;
  background: rgba(0,0,0,0.5);
 
  border-color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  aspect-ratio: 1/1;
 
  backdrop-filter: blur(10px);
}
 
.pub-action-btn-cover .pub-action-icon {
  font-size: 1.1rem; line-height: 1;
}
.pub-action-btn-cover .pub-action-icon img {
  filter: brightness(200);
}

/* ── Cart & Product UI ──────────────────────────────── */
.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--button-bg, #20558a); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}
.product-modal-img {
  width: 100%; height: 220px;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
}
.product-modal-body { padding: 1.25rem; }
.product-modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.product-modal-price { font-size: 1.15rem; font-weight: 600; color: var(--button-bg, #4f46e5); margin-bottom: 1rem; }
.product-modal-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.5rem; }
.product-modal-actions {
  display: flex; gap: 0.75rem; align-items: center;
}
.qty-selector {
  display: flex; align-items: center; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; height: 42px;
}
.qty-selector button {
  width: 38px; height: 100%; border: none; background: #f9fafb; cursor: pointer; font-size: 1.25rem; font-weight: 600; color: var(--text); outline: none; transition: background 0.2s;
}
.qty-selector button:hover { background: #f3f4f6; }
.qty-selector input {
  width: 44px; text-align: center; border: none; border-left: 2px solid var(--border); border-right: 2px solid var(--border); font-weight: 600; font-size: 1rem; color: var(--text); height: 100%; outline: none; background: transparent; pointer-events: none;
}
.qty-selector.small { height: 32px; border-width: 1px; }
.qty-selector.small button { width: 28px; font-size: 1rem; }
.qty-selector.small input { width: 32px; font-size: 0.9rem; border-width: 1px; }

.cart-item-row { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.cart-item-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.ci-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.15rem; }
.ci-price { font-size: 0.85rem; color: var(--text-muted); }

.cart-footer { padding: 1.25rem; border-top: 1px solid var(--border); background: #f9fafb; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }

.cart-toast {
  position: fixed; bottom: -80px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff;
  padding: 0.75rem 1rem; border-radius: var(--radius-md); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 1rem; width: 90%; max-width: 400px; z-index: 3000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0;
}
/* Move toast up higher on mobile to avoid bottom nav */
.cart-toast.show { bottom: calc(85px + env(safe-area-inset-bottom)); opacity: 1; }
.cart-toast .toast-btn {
  background: #4f46e5; color: #fff; border: none; padding: 0.4rem 0.75rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s; min-height: 36px;
}
.cart-toast .toast-btn:hover { opacity: 0.9; }

/* ── Global Media Queries ──────────────────────────────── */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cover-actions { flex-wrap: wrap; justify-content: flex-end; }
  
  /* Make tables responsive */
  .admin-table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .profile-cover { height: 160px; }
  .profile-content { padding: 4rem 1rem calc(80px + env(safe-area-inset-bottom)); }
}

/* ── Dashboard Mobile Sidebar ──────────────────────────────── */
.mobile-menu-btn {
  display: none; background: none; border: none; font-size: 1.5rem;
  color: var(--text); cursor: pointer; padding: 0.5rem; margin-right: 0.5rem;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 90; opacity: 0; transition: opacity 0.3s ease;
}
@media (max-width: 768px) {
  .dash-main { margin-left: 0; width: 100%; }
  .sidebar { 
    transform: translateX(-100%); width: 260px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-block; }
  .sidebar-overlay.open { display: block; opacity: 1; }
}
