/* ===== HanssoftAPI CSS - Clean Dark Rose Design ===== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --pink: #8B1A4A;
  --pink-light: #a82158;
  --pink-soft: #c97a9a;
  --pink-pale: #f9edf2;
  --pink-hover: #f2dde6;

  --bg: #fafafa;
  --bg-secondary: #f4f4f6;
  --bg-card: #ffffff;
  --bg-glass: rgba(255,255,255,0.85);
  --border: rgba(139,26,74,0.14);
  --border-card: rgba(0,0,0,0.07);
  --text: #18080f;
  --text-secondary: #5a3a47;
  --text-muted: #9a7a88;
  --text-on-pink: #ffffff;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 6px 32px rgba(0,0,0,0.11);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.24s cubic-bezier(0.4,0,0.2,1);
  --nav-bg: rgba(250,250,250,0.92);

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #1d4ed8;
}

[data-theme="dark"] {
  --bg: #0f0609;
  --bg-secondary: #170b10;
  --bg-card: #1e0e15;
  --bg-glass: rgba(30,14,21,0.88);
  --border: rgba(139,26,74,0.22);
  --border-card: rgba(139,26,74,0.1);
  --text: #f5e8ed;
  --text-secondary: #d4a0b4;
  --text-muted: #8a5f6f;
  --shadow: 0 2px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 6px 32px rgba(0,0,0,0.4);
  --nav-bg: rgba(15,6,9,0.94);
  --pink-pale: rgba(139,26,74,0.12);
  --pink-hover: rgba(139,26,74,0.18);
  --bg-secondary: #160c11;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--pink-soft); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--pink); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--border-card);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pink);
}

.nav-brand .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  border: 1.5px solid var(--pink-pale);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover { background: var(--pink-pale); color: var(--pink); }
.nav-links a.active { background: var(--pink-pale); color: var(--pink); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-pink {
  background: var(--pink);
  color: white;
  box-shadow: 0 2px 10px rgba(139,26,74,0.25);
}
.btn-pink:hover { background: var(--pink-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139,26,74,0.3); }

.btn-outline {
  background: transparent;
  color: var(--pink);
  border: 1.5px solid var(--pink);
}
.btn-outline:hover { background: var(--pink-pale); }

.btn-ghost { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border-card); }
.btn-ghost:hover { background: var(--pink-pale); color: var(--pink); border-color: var(--border); }

.btn-sm { padding: 6px 13px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 0.975rem; border-radius: 14px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; justify-content: center; }

/* ===== THEME TOGGLE ===== */
#themeToggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 9px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
#themeToggle:hover { background: var(--pink-pale); color: var(--pink); border-color: var(--border); }

/* ===== HAMBURGER ===== */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.hamburger span { width: 20px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: all 0.3s; display: block; }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  padding: 12px 16px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-nav a:hover { background: var(--pink-pale); color: var(--pink); }

/* ===== HERO SECTION ===== */
.hero {
  padding: 88px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}




.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.14;
  animation: floatBlob 10s ease-in-out infinite;
}
.hero-blob:nth-child(1) { width: 500px; height: 500px; background: var(--pink); top: -180px; left: -120px; }
.hero-blob:nth-child(2) { width: 360px; height: 360px; background: var(--pink-light); bottom: -80px; right: -80px; animation-delay: -3s; }
.hero-blob:nth-child(3) { width: 260px; height: 260px; background: #c2185b; top: 45%; left: 58%; animation-delay: -5s; }

@keyframes floatBlob {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(24px,-16px) scale(1.04); }
  66% { transform: translate(-16px,8px) scale(0.97); }
}

.hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pink-pale);
  color: var(--pink);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 22px;
  animation: fadeInUp 0.5s ease;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--pink);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.4; } }

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  animation: fadeInUp 0.5s ease 0.1s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--pink) 0%, #c2185b 60%, #d81b60 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 32px;
  animation: fadeInUp 0.5s ease 0.18s both;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease 0.26s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 56px;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s ease 0.34s both;
}

.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.9rem; font-weight: 800; color: var(--pink); line-height: 1; }
.hero-stat .label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ===== SECTION LAYOUT ===== */
.section { padding: 64px 24px; }
.section-sm { padding: 44px 24px; }
.container { max-width: 1160px; margin: 0 auto; }
.container-sm { max-width: 820px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 48px; }
.section-header .badge {
  display: inline-block;
  background: var(--pink-pale);
  color: var(--pink);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.section-header h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.section-header p { color: var(--text-secondary); font-size: 1rem; max-width: 500px; margin: 0 auto; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ===== GRID ===== */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ===== FEATURES ===== */
.feature-icon {
  width: 48px; height: 48px;
  background: var(--pink-pale);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--pink);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 7px; }
.feature-card p { color: var(--text-secondary); font-size: 0.875rem; }

/* ===== DOCS PAGE HEADER ===== */
.docs-page-header { padding: 28px 24px 22px; }

/* ===== API CATEGORY CHIPS ===== */
.cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}

.cat-chip {
  padding: 7px 16px;
  border-radius: 99px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border-card);
  transition: all var(--transition);
}
.cat-chip:hover, .cat-chip.active {
  background: var(--pink-pale);
  color: var(--pink);
  border-color: var(--border);
}

/* ===== API ENDPOINT CARDS ===== */
.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.endpoint-card:hover { border-color: rgba(139,26,74,0.3); box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.endpoint-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-card);
}

.method-badge {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.method-GET { background: rgba(22,163,74,0.12); color: #16a34a; }
.method-POST { background: rgba(29,78,216,0.12); color: #1d4ed8; }

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--pink);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-premium-badge {
  background: linear-gradient(135deg, #92400e, #b45309);
  color: white;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  flex-shrink: 0;
}

.endpoint-body { padding: 14px 18px; }
.endpoint-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.endpoint-desc { color: var(--text-secondary); font-size: 0.82rem; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.95) translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.modal-header > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.modal-header .font-mono {
  word-break: break-all;
  min-width: 0;
}
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.modal-close:hover { background: #fef2f2; color: var(--danger); border-color: rgba(220,38,38,0.2); }

/* Code inside modal wraps, scrolls horizontal */
.modal .code-block {
  overflow-x: auto;
}
.modal .code-block code {
  white-space: pre;
  word-break: normal;
  display: block;
}

/* Param row label + badge */
.modal .flex-between {
  flex-wrap: wrap;
  gap: 4px;
}

/* ===== ENDPOINT MODAL HEAD ===== */
.em-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-card);
  flex-shrink: 0;
}

.em-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.em-modal-info {
  padding: 14px 20px 0;
}

.em-modal-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.em-modal-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.em-modal-body {
  padding: 16px 20px 28px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===== SIMPLE ENDPOINT MODAL (sm-modal) ===== */
.sm-modal {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  max-width: 480px;
}

.sm-drag {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--border-card);
  border-radius: 99px;
  margin: 14px auto 0;
  flex-shrink: 0;
}

.sm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-card);
  flex-shrink: 0;
}

.sm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.sm-desc {
  font-size: 0.81rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.sm-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: var(--bg-secondary);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}
.sm-close:hover { background: #fef2f2; color: #dc2626; border-color: rgba(220,38,38,0.3); }

.sm-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sm-field { display: flex; flex-direction: column; gap: 5px; }

.sm-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sm-input {
  width: 100%;
  border: 1.5px solid var(--border-card);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-card);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.18s;
  font-family: 'Sora', sans-serif;
}
.sm-input:focus { border-color: var(--pink); }

.sm-submit {
  width: 100%;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  font-family: 'Sora', sans-serif;
  margin-top: 4px;
}
.sm-submit:hover { background: var(--pink-light); transform: translateY(-1px); }
.sm-submit:active { transform: translateY(0); }

.sm-result {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px;
  padding-right: 56px;
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 220px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.sm-result code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.77rem;
  white-space: pre;
  word-break: normal;
  display: block;
  color: var(--text);
  line-height: 1.7;
}

.sm-copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.68rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  transition: all 0.18s;
}
.sm-copy-btn:hover { background: var(--pink-pale); color: var(--pink); }

/* Param rows */
.pg-param-row {
  margin-bottom: 12px;
}
.pg-param-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pink);
}
.pg-param-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid var(--border-card);
}
.pg-param-badge.required {
  background: rgba(139,26,74,0.1);
  color: var(--pink);
  border-color: rgba(139,26,74,0.25);
}
.pg-param-badge.optional {
  background: var(--bg-secondary);
  color: var(--text-muted);
}
.pg-no-params {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 10px 0;
}

/* Submit button */
.em-submit-btn {
  margin-top: 8px;
}

/* Result */
#pg_result {
  max-height: 220px;
  overflow-y: auto;
}

/* Modal tabs */
.em-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px 0;
  border-bottom: 1.5px solid var(--border-card);
  margin-bottom: 0;
}

.modal-tab-btn {
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1.5px;
  border-radius: 0;
  transition: color 0.2s, border-color 0.2s;
}

.modal-tab-btn:hover {
  color: var(--pink);
}

.modal-tab-btn.active {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

/* Tab panes: hidden by default, shown when active */
.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

/* Examples — always single column, stacked vertically */
.modal-examples-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 5px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-card);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 0.875rem;
  transition: all var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(139,26,74,0.1); }
.form-control::placeholder { color: var(--text-muted); }

.form-control-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.84rem; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.4s ease;
}

.auth-logo { text-align: center; margin-bottom: 26px; }

.auth-logo .logo-img {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  border: 2px solid var(--pink-pale);
  box-shadow: 0 4px 16px rgba(139,26,74,0.12);
}

.auth-logo .auth-title { font-size: 1.5rem; font-weight: 800; margin-top: 14px; letter-spacing: -0.02em; }
.auth-logo .auth-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: 4px; }

.auth-links { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-secondary); }
.auth-links a { color: var(--pink); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ===== ALERT ===== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
[data-theme="dark"] .alert-error { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.25); color: #fca5a5; }
[data-theme="dark"] .alert-success { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.25); color: #86efac; }
[data-theme="dark"] .alert-info { background: rgba(29,78,216,0.1); border-color: rgba(29,78,216,0.25); color: #93c5fd; }

/* ===== DASHBOARD ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 60px);
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-card);
  padding: 20px 14px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px; padding: 0 8px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.sidebar-link:hover { background: var(--pink-pale); color: var(--pink); }
.sidebar-link.active { background: var(--pink-pale); color: var(--pink); font-weight: 600; }
.sidebar-link .icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.dash-main { padding: 28px; overflow-x: hidden; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.stat-icon { position: absolute; right: 18px; top: 18px; color: var(--pink); opacity: 0.15; }

/* ===== STATUS BADGE ===== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
}
.badge-active { background: rgba(22,163,74,0.12); color: #15803d; }
.badge-inactive { background: rgba(220,38,38,0.1); color: #dc2626; }
.badge-premium { background: rgba(146,64,14,0.12); color: #92400e; border: 1px solid rgba(180,83,9,0.2); }

/* ===== CODE BLOCK ===== */
.code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.81rem;
  overflow-x: auto;
  position: relative;
  color: var(--text);
  line-height: 1.7;
}
[data-theme="dark"] .code-block { background: #0a0005; border-color: rgba(139,26,74,0.18); }
.code-block .copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
}
.code-block .copy-btn:hover { background: var(--pink-pale); color: var(--pink); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-card); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-secondary); }
th { padding: 11px 14px; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
td { padding: 13px 14px; border-top: 1px solid var(--border-card); font-size: 0.875rem; }
tr:hover td { background: var(--bg-secondary); }

/* ===== PRICING ===== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; max-width: 960px; margin: 0 auto; }

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.pricing-card.featured {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(139,26,74,0.12), var(--shadow-lg);
}

.pricing-card.featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--pink-light));
}

.pricing-tag {
  position: absolute;
  top: 18px; right: -28px;
  background: var(--pink);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 38px;
  transform: rotate(38deg);
  letter-spacing: 0.04em;
}

.pricing-name { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 10px; }
.pricing-price { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 4px; }
.pricing-price .currency { font-size: 1.1rem; vertical-align: top; margin-top: 10px; display: inline-block; }
.pricing-price .period { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.pricing-free { color: var(--pink); }
.pricing-pro { color: var(--pink-light); }
.pricing-ent { color: #16a34a; }

.pricing-features { list-style: none; margin: 24px 0; text-align: left; }
.pricing-features li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.875rem; border-bottom: 1px solid var(--border-card); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-features .check { color: #16a34a; flex-shrink: 0; }
.pricing-features .cross { color: var(--danger); flex-shrink: 0; }

/* ===== PLAYGROUND ===== */
.playground { background: var(--bg-secondary); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border-card); }
.playground-url { display: flex; gap: 10px; margin-bottom: 18px; }
.playground-url input {
  flex: 1;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.playground-url input:focus { border-color: var(--pink); }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-card);
  padding: 52px 24px 28px;
  margin-top: auto;
}

.footer-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-card);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-logo {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: var(--pink) !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 220px;
  line-height: 1.5;
  margin: 0;
}

.footer-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

footer .footer-nav a {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  font-size: 0.845rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

footer .footer-nav a:hover {
  background: var(--pink-pale);
  color: var(--pink) !important;
}

.footer-nav-icon {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.footer-bottom p { margin: 0; }

.footer-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  padding: 2px 4px;
  border-radius: 4px;
}

.footer-legal a:hover { color: var(--pink); }

.footer-dot {
  color: var(--border-card);
  font-size: 0.6rem;
  line-height: 1;
  filter: brightness(1.5);
}

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-in { animation: fadeInUp 0.45s ease both; }
.animate-delay-1 { animation-delay: 0.08s; }
.animate-delay-2 { animation-delay: 0.16s; }
.animate-delay-3 { animation-delay: 0.24s; }

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-card) 50%, var(--bg-secondary) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--pink);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34,1.4,0.64,1);
  max-width: 320px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

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

/* ===== NAVBAR MOBILE EXTRAS ===== */
.brand-badge {
  font-size: 0.66rem;
  background: var(--pink-pale);
  color: var(--pink);
  border-radius: 5px;
  padding: 2px 7px;
  font-weight: 700;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-auth-btns { display: flex; align-items: center; gap: 8px; }
.mobile-nav-divider { height: 1px; background: var(--border-card); margin: 6px 0; }
.mobile-nav-danger { color: var(--danger) !important; }
.mobile-nav-cta { background: var(--pink-pale) !important; color: var(--pink) !important; font-weight: 700 !important; }

/* ===== MOBILE DASHBOARD TOP BAR ===== */
.dash-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 50;
}

.dash-mobile-menu-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}
.dash-mobile-menu-btn:hover { background: var(--pink-pale); color: var(--pink); }

/* ===== SIDEBAR DRAWER (MOBILE) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sidebar-overlay.open { display: block; animation: fadeIn 0.2s ease; }

.sidebar.mobile-open {
  transform: translateX(0) !important;
  box-shadow: 6px 0 48px rgba(0,0,0,0.22);
}

/* ===== LARGE TABLET (≤1024px) ===== */
@media (max-width: 1024px) {
}

/* ===== TABLET / DASHBOARD BREAK (≤960px) ===== */
@media (max-width: 960px) {
  /* Dashboard layout */
  .dashboard-layout { grid-template-columns: 1fr; }

  /* Sidebar becomes off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: min(280px, 80vw);
    height: 100vh;
    z-index: 210;
    transform: translateX(-110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 0;
    border-right: 1px solid var(--border-card);
    overflow-y: auto;
  }

  .sidebar-close-bar { display: block !important; }
  .dash-mobile-header { display: flex; }
  .dash-main { padding: 20px 16px; overflow-x: hidden; }
  .footer-main { flex-direction: column; align-items: flex-start; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .footer-brand { max-width: 100%; }
}


/* ===== MOBILE (≤768px) ===== */
@media (max-width: 768px) {
  /* Navbar */
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .navbar { padding: 0 14px; height: 56px; }
  .brand-name { font-size: 0.95rem; }
  /* Hide all auth buttons on mobile — they live in the hamburger menu */
  .nav-auth-btns { display: none; }

  /* Hero */
  .hero { padding: 48px 16px 36px; }
  .hero h1 { font-size: clamp(1.75rem, 7.5vw, 2.8rem); line-height: 1.2; }
  .hero p { font-size: 0.9rem; max-width: 100%; }
  .hero-actions { gap: 10px; flex-wrap: wrap; }
  .hero-text { padding: 32px 16px 20px; }

  /* Hero stats: 2×2 grid */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
    margin-top: 32px;
    justify-items: center;
    text-align: center;
  }
  .hero-stat .num { font-size: 1.5rem; }
  .hero-stat .label { font-size: 0.72rem; }

  /* Sections */
  .section { padding: 40px 14px; }
  .section-sm { padding: 28px 14px; }
  .section-header { margin-bottom: 28px; }
  .section-header h2 { font-size: clamp(1.4rem, 5vw, 2rem); }

  /* Auth */
  .auth-card { padding: 26px 18px; }
  .auth-logo .auth-title { font-size: 1.3rem; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard specific */
  .dash-main { padding: 16px 12px; overflow-x: hidden; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 1.7rem; }
  .stat-label { font-size: 0.7rem; }
  .stat-icon { right: 14px; top: 14px; }

  /* Dashboard greeting row */
  .dash-greeting-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }

  /* Card */
  .card { padding: 18px 14px; }

  /* Table */
  .table-wrap { border-radius: 10px; }
  .table-wrap table { font-size: 0.78rem; min-width: 500px; }
  th { padding: 9px 10px; }
  td { padding: 10px 10px; }

  /* Modal — bottom sheet on mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-overlay .modal {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    padding: 28px;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal {
    transform: translateY(0);
  }

  /* em-modal bottom sheet specifics */
  .em-modal {
    padding: 0 !important;
    max-height: 88vh;
    border-radius: 20px 20px 0 0 !important;
    display: flex;
    flex-direction: column;
  }

  .em-modal-drag {
    display: block;
  }

  .em-modal-head {
    padding: 10px 16px 10px;
  }

  .em-modal-path {
    font-size: 0.76rem;
    max-width: calc(100vw - 120px);
  }

  .em-modal-info {
    padding: 10px 16px 10px;
  }

  .em-modal-name {
    font-size: 0.92rem;
  }

  .em-modal-desc {
    font-size: 0.78rem;
  }

  .em-modal-tabs {
    padding: 10px 16px 0;
  }

  .modal-tab-btn {
    font-size: 0.78rem;
    padding: 7px 14px;
  }

  .em-modal-body {
    padding: 14px 16px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .em-code {
    font-size: 0.72rem;
    padding: 10px 12px;
    padding-right: 46px;
    max-height: 160px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .em-code .code-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
  }
  .em-code .code-container code {
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    display: block;
  }

  .em-modal-body {
    overflow-x: hidden;
  }

  .pg-param-name { font-size: 0.75rem; }
  .pg-param-badge { font-size: 0.65rem; }

  .em-modal-body .form-control {
    font-size: 0.8rem;
    padding: 9px 11px;
  }

  /* Result area compact on mobile */
  #pg_result {
    max-height: 140px !important;
  }

  .modal-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.85rem;
  }

  .divider { margin: 12px 0; }

  /* Category chips */
  .cat-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cat-chips::-webkit-scrollbar { height: 0; }
  .cat-chip { white-space: nowrap; flex-shrink: 0; font-size: 0.76rem; padding: 6px 13px; }

  /* Docs page header */
  .docs-page-header { padding: 18px 16px 14px; }
  .docs-page-header .flex-between > div:last-child { max-width: 100% !important; }
  /* Docs search */
  .docs-search-wrap { width: 100% !important; }
  .docs-search-wrap input { width: 100% !important; }

  /* Buttons */
  .btn-lg { padding: 11px 20px; font-size: 0.88rem; }

  /* Misc */
  .pricing-card { padding: 22px 18px; }
  .flex-between { flex-wrap: wrap; gap: 10px; }
  .footer-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }

  /* Toast */
  #toast-container { left: 10px; right: 10px; bottom: 14px; }
  .toast { max-width: 100%; font-size: 0.82rem; padding: 10px 14px; }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  .navbar { padding: 0 12px; }

  /* Hero */
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }

  /* Hero stats keep 2×2 */
  .hero-stats { gap: 12px 16px; }
  .hero-stat .num { font-size: 1.35rem; }

  /* Grid */
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Dashboard */
  .dash-main { padding: 12px 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 1.55rem; }

  /* Footer */
  .footer-nav a { font-size: 0.82rem; }
  .footer-legal { gap: 6px; }
  .pricing-grid { grid-template-columns: 1fr; }

  /* Code block */
  .code-block { font-size: 0.75rem; padding: 12px; }

  /* Auth card */
  .auth-card { padding: 22px 14px; max-width: 100%; }

  /* CTA section */
  .section [style*="padding:52px"] { padding: 36px 20px !important; }
}

/* ===== VERY SMALL (≤380px) ===== */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.5rem; }
  .btn { padding: 8px 13px; font-size: 0.8rem; }
  .btn-lg { padding: 10px 16px; font-size: 0.85rem; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 1.4rem; }
  .brand-badge { display: none; }
}

/* ===== ADMIN ===== */

/* Navbar */
.admin-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  background: rgba(10,0,6,0.97);
  border-bottom: 1px solid rgba(139,26,74,0.18);
  position: sticky;
  top: 0;
  z-index: 200;
  overflow: hidden;
  flex-wrap: nowrap;
}
.admin-navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}
.admin-navbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.admin-nav-brand-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--pink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-navbar-website { display: inline-flex; }

/* Layout */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }

/* Sidebar */
.admin-sidebar {
  background: #090007;
  color: #f0e6ec;
  padding: 20px 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  border-right: 1px solid rgba(139,26,74,0.12);
  z-index: 150;
}
.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--pink-soft);
}
.admin-sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 14px 0;
}
.admin-sidebar .sidebar-link {
  color: rgba(240,230,236,0.5);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.18s ease;
  margin-bottom: 2px;
}
.admin-sidebar .sidebar-link .icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.admin-sidebar .sidebar-link:hover { background: rgba(139,26,74,0.15); color: #f0e6ec; }
.admin-sidebar .sidebar-link.active { background: rgba(139,26,74,0.25); color: var(--pink-soft); font-weight: 600; }
.admin-sidebar .sidebar-link-danger { color: rgba(255,90,90,0.55); }
.admin-sidebar .sidebar-link-danger:hover { background: rgba(180,30,30,0.12); color: rgba(255,110,110,0.85); }
.admin-sidebar .sidebar-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(240,230,236,0.25);
  padding: 12px 12px 5px;
  font-weight: 600;
}
.admin-main { background: var(--bg); padding: 28px; overflow-x: hidden; }

/* Page header */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.admin-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #f0e6ec;
}
.admin-page-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
}
.admin-page-meta .meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: inline-block;
}

/* Hamburger */
.admin-hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(139,26,74,0.28);
  border-radius: 7px;
  color: var(--pink-soft);
  cursor: pointer;
  padding: 5px 7px;
  line-height: 0;
  transition: background 0.18s;
}
.admin-hamburger:hover { background: rgba(139,26,74,0.15); }

/* Sidebar Overlay */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 140;
  backdrop-filter: blur(2px);
}
.admin-sidebar-overlay.open { display: block; }

/* Sidebar close btn (mobile) */
.admin-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(240,230,236,0.4);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  border-radius: 6px;
  transition: color 0.18s;
}
.admin-sidebar-close:hover { color: rgba(240,230,236,0.8); }

/* Stat cards */
.stat-card-admin {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card-admin:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card-admin .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}
.stat-card-admin .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-card-admin .stat-change { font-size: 0.73rem; color: var(--text-muted); margin-top: 5px; }

/* Stat card icon wrappers */
.stat-card-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.stat-icon-blue  { background: rgba(59,130,246,0.12); color: #60a5fa; }
.stat-icon-pink  { background: rgba(139,26,74,0.18);  color: var(--pink-soft); }
.stat-icon-red   { background: rgba(220,50,50,0.12);  color: #f87171; }
.stat-icon-green { background: rgba(34,197,94,0.12);  color: #4ade80; }

/* Card title */
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0e6ec;
}
.card-title.mb-4 { margin-bottom: 16px; }

/* List rows */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-card);
}
.list-row:last-child { border-bottom: none; }
.list-row-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 0.88rem;
}
.list-row-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.rank-1 { background: rgba(234,179,8,0.15); color: #fbbf24; }
.rank-2 { background: rgba(148,163,184,0.15); color: #94a3b8; }
.rank-3 { background: rgba(180,100,50,0.15); color: #cd7c54; }

@media (max-width: 900px) {
  .admin-hamburger { display: block; }
  .admin-sidebar-close { display: block; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-navbar-website { display: none; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    transform: translateX(-110%);
    transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
    z-index: 150;
    padding-top: 16px;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 18px; }
}

@media (max-width: 480px) {
  .admin-main { padding: 14px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .admin-page-title { font-size: 1.15rem; }
  .admin-navbar { padding: 0 12px; }
  .admin-nav-brand-inline span { font-size: 0.82rem; }
  .admin-navbar-logout-text { display: none; }
}

/* ===== UTILITY ===== */
.text-pink { color: var(--pink); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.rounded { border-radius: var(--radius); }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { border: none; border-top: 1px solid var(--border-card); margin: 18px 0; }
.hidden { display: none !important; }

/* ===== LUCIDE ICON SIZING ===== */
[data-lucide] { display: inline-block; }
.icon-sm svg, .icon-sm [data-lucide] { width: 14px; height: 14px; }
.icon-md svg, .icon-md [data-lucide] { width: 18px; height: 18px; }
.icon-lg svg, .icon-lg [data-lucide] { width: 24px; height: 24px; }
