/* =============================================
   QSBD — Queer Small Business Directory
   ============================================= */

:root {
  --bg:           #f5f3ff;
  --bg-card:      #ffffff;
  --bg-nav:       #ffffff;
  --bg-input:     #ffffff;
  --bg-secondary: #ede9ff;
  --text:         #1e1b4b;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --border:       #e0d9ff;
  --border-focus: #7c3aed;
  --accent:       #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #ede9fe;
  --shadow-sm:    0 1px 3px rgba(124,58,237,.08);
  --shadow:       0 4px 16px rgba(124,58,237,.12);
  --shadow-lg:    0 8px 32px rgba(124,58,237,.16);
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    20px;
  --rainbow:      linear-gradient(90deg,#e40303,#ff8c00,#ffed00,#008026,#004dff,#750787);
  --rainbow-pride: linear-gradient(135deg,#000 0%,#784f17 14%,#74d7ee 28%,#ffafc8 42%,#fff 56%,#e40303 62%,#ff8c00 70%,#ffed00 77%,#008026 84%,#004dff 92%,#750787 100%);
  --trans-gradient: linear-gradient(135deg,#74d7ee,#ffafc8,#fff,#ffafc8,#74d7ee);
  --font: system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

[data-theme="dark"] {
  --bg:           #0d0c1a;
  --bg-card:      #13122a;
  --bg-nav:       #0f0e20;
  --bg-input:     #1a1931;
  --bg-secondary: #1a1931;
  --text:         #f0ecff;
  --text-muted:   #9d9bc0;
  --text-light:   #6b6990;
  --border:       #252442;
  --border-focus: #a78bfa;
  --accent:       #a78bfa;
  --accent-hover: #8b5cf6;
  --accent-light: #1e1b40;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow:       0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.6);
}

*, *::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);
  line-height: 1.6;
  transition: background .3s, color .3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ---- RAINBOW BAR ---- */
.rainbow-bar {
  height: 4px;
  background: var(--rainbow);
  flex-shrink: 0;
}

/* ---- NAV ---- */
.site-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background .3s;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.nav-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .4rem 1rem;
  gap: .5rem;
  max-width: 480px;
}

.nav-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.nav-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
  outline: none;
}
.nav-search input::placeholder { color: var(--text-muted); }

.nav-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

.btn-theme {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 99px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.btn-theme:hover { border-color: var(--accent); color: var(--accent); }
.btn-theme svg { width: 18px; height: 18px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }

.btn-danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }

/* ---- SLIDER ---- */
.slider-wrap {
  position: relative;
  background: #0d0c1a;
  overflow: hidden;
}

.slider {
  position: relative;
  height: 500px;
}

@media (max-width: 768px) { .slider { height: 320px; } }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1a1929;
}
.slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.7) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
}

.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  max-width: 640px;
}

.slide-content h2 {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .75rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

.slide-content p {
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.slider-btn:hover { background: rgba(255,255,255,.3); }
.slider-btn.prev { left: 1.5rem; }
.slider-btn.next { right: 1.5rem; }
.slider-btn svg { width: 22px; height: 22px; }

.slider-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: .5rem;
}
.slider-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  border: none;
  transition: all .2s;
  padding: 0;
}
.slider-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* ---- CTA BAND ---- */
.cta-section {
  background: var(--accent);
  background: linear-gradient(135deg, var(--accent), #a21caf);
  padding: 3.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.cta-section .inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}
.cta-section h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: .75rem;
}
.cta-section p {
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
}
.cta-section .btn {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}
.cta-section .btn:hover { background: rgba(255,255,255,.9); }

/* ---- MAIN CONTENT ---- */
.main-content { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ---- SEARCH & FILTER ---- */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.filter-bar form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }

.filter-group { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 160px; }
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.filter-group input,
.filter-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  background: var(--bg-input);
  color: var(--text);
  font-size: .875rem;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
.filter-group input:focus,
.filter-group select:focus { border-color: var(--border-focus); }

.filter-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.filter-section-title h2 { font-size: 1.5rem; font-weight: 800; }
.result-count { color: var(--text-muted); font-size: .875rem; }

/* ---- BUSINESS GRID ---- */
.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ---- BUSINESS CARD ---- */
.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s, transform .25s, border-color .25s;
  position: relative;
}
.biz-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.biz-card-rainbow { height: 4px; background: var(--rainbow); }

.biz-card-featured { border-color: #f59e0b; }
.biz-card-featured .biz-card-rainbow { background: linear-gradient(90deg,#f59e0b,#fbbf24,#f59e0b); }

.featured-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: #f59e0b;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2rem .55rem;
  border-radius: 99px;
}

.biz-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .75rem; }

.biz-card-logo-wrap {
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.biz-logo {
  max-width: 100%;
  max-height: 90px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.biz-logo-placeholder {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  background: var(--rainbow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
}

.biz-card-head { display: flex; flex-direction: column; gap: .25rem; }

.biz-meta { min-width: 0; }
.biz-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: .4rem;
  flex-wrap: wrap;
}

.verified-icon {
  color: #3b82f6;
  display: inline-flex;
  flex-shrink: 0;
}
.verified-icon svg { width: 16px; height: 16px; }

.biz-owner { font-size: .8rem; color: var(--text-muted); }

.queer-pill {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  margin-top: .2rem;
}
.queer-pill.queer { background: var(--rainbow); color: #fff; }
.queer-pill.ally { background: #e0f2fe; color: #0369a1; }
[data-theme="dark"] .queer-pill.ally { background: #0c3a5a; color: #7dd3fc; }

.biz-location { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; }
.biz-location svg { width: 14px; height: 14px; flex-shrink: 0; }

.biz-price { font-size: .82rem; font-weight: 600; color: var(--accent); }

.biz-sell {
  font-size: .85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- BADGES ---- */
.badge-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1.5px solid;
}
.badge-woman    { color: #db2777; border-color: #db2777; background: #fdf2f8; }
.badge-trans    { color: #0891b2; border-color: #0891b2; background: #ecfeff; }
.badge-intersex { color: #7c3aed; border-color: #7c3aed; background: var(--accent-light); }
.badge-hispanic { color: #b45309; border-color: #b45309; background: #fffbeb; }
.badge-black    { color: #374151; border-color: #374151; background: #f9fafb; }

[data-theme="dark"] .badge-woman    { background: #4a0726; }
[data-theme="dark"] .badge-trans    { background: #0c2c3a; }
[data-theme="dark"] .badge-intersex { background: var(--accent-light); }
[data-theme="dark"] .badge-hispanic { background: #3a2700; }
[data-theme="dark"] .badge-black    { background: #1f2937; color: #e5e7eb; border-color: #6b7280; }

.location-features { display: flex; flex-wrap: wrap; gap: .35rem; }
.loc-feature {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: .25rem;
}

/* ---- SOCIAL ICONS ---- */
.social-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-link {
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all .2s;
}
.social-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.social-link svg { width: 14px; height: 14px; }

/* ---- CARD FOOTER ---- */
.biz-card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

/* ---- BUSINESS DETAIL PAGE ---- */
.biz-detail { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

.biz-detail-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.biz-hero-rainbow { height: 6px; background: var(--rainbow); }

.biz-hero-body { padding: 2rem; }

.biz-hero-top {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.biz-hero-logo {
  max-width: 220px;
  max-height: 150px;
  width: auto;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: .75rem;
  flex-shrink: 0;
  align-self: flex-start;
}
.biz-hero-logo-placeholder {
  width: 100px; height: 100px;
  border-radius: var(--radius);
  background: var(--rainbow);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}

.biz-hero-info { flex: 1; min-width: 200px; }
.biz-hero-name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}

.biz-hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .75rem; }
.biz-hero-meta-item { display: flex; align-items: center; gap: .4rem; font-size: .875rem; color: var(--text-muted); }
.biz-hero-meta-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.biz-hero-meta-item a { color: var(--accent); }

.biz-detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) { .biz-detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.detail-card h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.detail-card p { font-size: .95rem; line-height: 1.7; color: var(--text); }

/* ---- PHOTO GALLERY ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .2s;
}
.gallery-item:hover::after { background: rgba(0,0,0,.15); }

/* ---- LIGHTBOX ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.8);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}
.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-nav.prev { left: 1.5rem; }
.lightbox-nav.next { right: 1.5rem; }
.lightbox-nav svg { width: 22px; height: 22px; }

/* ---- OWNER CARD ---- */
.owner-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: .75rem;
}
.owner-photo-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: .75rem;
}

/* ---- BACK LINK ---- */
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .875rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 1rem; opacity: .4; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; color: var(--text); }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { display: flex; align-items: center; }
.footer-logo-img { height: 36px; width: auto; object-fit: contain; display: block; }
.footer-text { font-size: .85rem; color: var(--text-muted); }

/* =============================================
   ADMIN / DASH
   ============================================= */
.dash-layout { display: flex; min-height: 100vh; }

.dash-sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.dash-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.1rem;
}
.dash-logo-img { height: 36px; width: auto; object-fit: contain; display: block; margin-bottom: .3rem; }
.dash-logo small { display: block; font-size: .7rem; font-weight: 400; color: var(--text-muted); }

.dash-nav { flex: 1; padding: 1rem 0; }
.dash-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.dash-nav a:hover { color: var(--text); background: var(--bg-secondary); }
.dash-nav a.active { color: var(--accent); background: var(--accent-light); border-left-color: var(--accent); font-weight: 600; }
.dash-nav svg { width: 18px; height: 18px; flex-shrink: 0; }

.dash-nav-section { padding: .75rem 1.5rem .35rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }

.dash-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.dash-footer a { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.dash-footer a:hover { color: var(--accent); }
.dash-footer svg { width: 15px; height: 15px; }

.dash-main {
  flex: 1;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-topbar h1 { font-size: 1.15rem; font-weight: 700; }
.dash-content { padding: 2rem; flex: 1; }

/* ---- STAT CARDS ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .5rem; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-card .sub { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ---- ADMIN TABLES ---- */
.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table th {
  text-align: left;
  padding: .75rem 1.25rem;
  background: var(--bg-secondary);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-secondary); }

.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 99px;
  border: 1.5px solid;
  cursor: pointer;
  background: transparent;
  transition: all .2s;
}
.toggle-btn.on  { color: #16a34a; border-color: #16a34a; }
.toggle-btn.off { color: var(--text-muted); border-color: var(--border); }
.toggle-btn:hover { opacity: .8; }

/* ---- FORMS ---- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.form-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  background: var(--bg-input);
  color: var(--text);
  font-size: .875rem;
  width: 100%;
  outline: none;
  font-family: var(--font);
  transition: border-color .2s;
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--border-focus); }

.form-check-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; }
.form-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text);
}
.form-check input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ---- CURRENT IMAGE PREVIEW ---- */
.current-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  margin-bottom: .5rem;
}
.current-img-round { border-radius: 50%; }

/* ---- PHOTO GRID IN ADMIN ---- */
.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; margin-top: .75rem; }
.photo-admin-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-admin-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-admin-item label.delete-check {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .75rem;
}

/* ---- ALERTS ---- */
.alert {
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
}
.alert-success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
[data-theme="dark"] .alert-success { background: #052e16; border-color: #166534; color: #4ade80; }
[data-theme="dark"] .alert-error   { background: #3b0c0c; border-color: #7f1d1d; color: #f87171; }

/* ---- UPLOAD OVERLAY ---- */
.upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}
.upload-overlay.visible { display: flex; }

.upload-spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-overlay p {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.upload-overlay small {
  color: rgba(255,255,255,.6);
  font-size: .8rem;
}

/* ---- FILE INPUT LABEL ---- */
.file-chosen {
  font-size: .78rem;
  color: var(--accent);
  margin-top: .35rem;
  font-weight: 500;
  display: none;
}
.file-chosen.visible { display: block; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-card .logo { font-size: 1.75rem; font-weight: 900; margin-bottom: 1.75rem; text-align: center; }
.login-card .logo span { background: var(--rainbow); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ---- UTILITIES ---- */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.flex { display: flex; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.inline-flex { display: inline-flex; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; }
  .dash-nav { display: flex; flex-wrap: wrap; padding: .5rem; }
  .dash-nav a { padding: .5rem .75rem; border-left: none; border-radius: var(--radius-sm); }
}
@media (max-width: 768px) {
  .slide-content { padding: 2rem; }
  .biz-detail-grid { grid-template-columns: 1fr; }
  .nav-search { display: none; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .dash-content { padding: 1rem; }
}
