:root {
  --accent: #459284;
  --accent-dark: #327165;
  --accent-soft: rgba(69, 146, 132, 0.12);
  --bg: #f6f7f7;
  --bg-alt: #eef2f1;
  --surface: #ffffff;
  --text: #1a2228;
  --muted: #5a6670;
  --border: #dde3e6;
  --danger: #b91c1c;
  --gold: #b45309;
  --shadow: 0 10px 28px rgba(18, 28, 36, 0.06);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #111619;
  --bg-alt: #171e22;
  --surface: #1b2328;
  --text: #ecf1f4;
  --muted: #9aa7b2;
  --border: #2a363d;
  --accent-soft: rgba(69, 146, 132, 0.22);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.public-body { padding-bottom: 64px; }

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

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow-container { max-width: 860px; }
.muted { color: var(--muted); }
.small-text { font-size: 0.9rem; }
.inline-form { display: inline; }

/* Header & Navigation */
.site-header, .admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner, .admin-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 0.98rem; }
.brand-text small { font-size: 0.78rem; color: var(--muted); }

.desktop-nav {
  display: none;
  gap: 18px;
  align-items: center;
}

.nav-link {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent); text-decoration: none; }

.header-actions, .admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); text-decoration: none; }

[data-theme="light"] .theme-label-dark { display: none; }
[data-theme="dark"] .theme-label-light { display: none; }

.mobile-drawer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-drawer-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 6px 0;
}
.mobile-drawer-meta {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Mobile bottom bar */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: 56px;
}

.bottom-bar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

/* Buttons & Cards */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-xs { padding: 4px 9px; font-size: 0.78rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-gold { background: #d97706; color: #fff; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Hero & Sections */
.hero-studio {
  padding: 48px 0;
  background: linear-gradient(155deg, var(--accent-soft) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: center;
}

.hero-studio h1 {
  margin: 12px 0;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.15;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 22px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.section { padding: 44px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h1, .section-head h2 { margin: 0; }

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}
.cat-pill.is-active, .cat-pill:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.cards-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.content-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-cover { width: 100%; height: 190px; object-fit: cover; display: block; }
.card-body { padding: 20px; }
.card-body h3 { margin: 6px 0 8px; font-size: 1.12rem; }
.meta-date { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.article-header { margin-bottom: 24px; }
.article-cover { margin: 0 0 24px; }
.article-cover img { width: 100%; border-radius: var(--radius); max-height: 460px; object-fit: cover; }
.rich-content img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.rich-content th, .rich-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }

/* Alerts & Forms */
.alert {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.auth-container { max-width: 480px; }
.stack-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 0.92rem; }
.field > span { font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.checkbox-field { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 40px;
}
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

/* Admin Shell */
.admin-shell {
  display: grid;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 48px;
}
.admin-sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-nav-item {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-nav-item.is-active, .admin-nav-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.admin-header { margin-bottom: 20px; }
.admin-header h1 { margin: 0 0 6px; }
.admin-header-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }

.claim-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-left: 5px solid #d97706;
  margin-bottom: 20px;
}

.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
.stat-card { display: grid; gap: 6px; color: var(--text); }
.stat-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.9rem; line-height: 1.1; }
.stat-alert { color: var(--danger); }

.admin-cards-grid, .two-cols, .three-cols, .split-grid { display: grid; gap: 16px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.settings-grid { display: grid; gap: 16px; }
.setting-row { display: grid; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.role-badge, .mini-badge, .status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.media-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.media-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.media-doc-badge { height: 140px; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--accent); background: var(--accent-soft); }
.media-meta { padding: 10px; display: grid; gap: 4px; }
.media-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.86rem; }

/* Stage 2: Portfolio Gallery, Designers, Moderation, Lightbox */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.search-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-inline input, .search-inline select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.portfolio-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.portfolio-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.portfolio-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--bg-alt);
  cursor: zoom-in;
  overflow: hidden;
}
.portfolio-thumb-btn img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.portfolio-card:hover .portfolio-thumb-btn img { transform: scale(1.03); }

.designer-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.designer-card-head { display: flex; align-items: center; gap: 14px; }
.designer-avatar, .designer-avatar-fallback {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.designer-avatar-fallback, .designer-avatar-lg-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 1.3rem;
}
.designer-card-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }

.designer-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.designer-portrait-lg, .designer-avatar-lg-fallback {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}
.designer-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.skill-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.skill-list li { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.nav-count-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
}

.moderation-mini-row, .moderation-item-card {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.moderation-mini-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.moderation-item-card img { width: 150px; height: 110px; object-fit: cover; border-radius: 8px; }
.moderation-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.moderation-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.role-inline-form { display: inline-flex; gap: 4px; align-items: center; }
.role-inline-form select { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 0.78rem; }

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 16, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox-backdrop[hidden] { display: none; }
.lightbox-dialog {
  position: relative;
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-figure { margin: 0; display: grid; gap: 12px; }
.lightbox-figure img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #0f1417; }
.lightbox-caption h3 { margin: 0 0 4px; }
.lightbox-caption p { margin: 0 0 6px; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { top: 42%; left: 12px; }
.lightbox-next { top: 42%; right: 12px; }

@media (min-width: 768px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .public-body { padding-bottom: 0; }
  .mobile-menu-btn, .mobile-bottom-bar { display: none; }
  .desktop-nav { display: flex; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .two-cols, .setting-row, .admin-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .three-cols { grid-template-columns: repeat(3, 1fr); }
  .split-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }
}

@media (min-width: 980px) {
  .admin-shell { grid-template-columns: 230px 1fr; align-items: start; }
  .admin-sidebar { flex-direction: column; position: sticky; top: 88px; }
}

@media (max-width: 600px) {
  .hide-sm { display: none; }
}
