/* ============================================================
   LunoxLibrary ~ app.css
   Design tokens match the React app's tailwind theme
   ============================================================ */

:root {
  --primary:        #60a5fa;
  --primary-dark:   #3b82f6;
  --primary-light:  #dbeafe;
  --slate-50:       #f8fafc;
  --slate-100:      #f1f5f9;
  --slate-200:      #e2e8f0;
  --slate-300:      #cbd5e1;
  --slate-400:      #94a3b8;
  --slate-500:      #64748b;
  --slate-600:      #475569;
  --slate-700:      #334155;
  --slate-800:      #1e293b;
  --slate-900:      #0f172a;
  --blue-50:        #eff6ff;
  --font: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --radius-card:    2rem;
  --radius-hero:    2.5rem;
  --shadow-card:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-primary: 0 8px 24px rgba(96,165,250,.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: #eff6ff55; color: var(--slate-800); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ─── Container ─── */
.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ─── Navbar ─── */
.navbar { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border-bottom: 1px solid #bfdbfe55; position: sticky; top: 0; z-index: 50; }
.navbar-inner { height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.logo-link { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.logo-icon-main { display: flex; transition: transform .2s; }
.logo-link:hover .logo-icon-main { transform: scale(1.1); }
.logo-icon-main img { width: 40px; height: 40px; }
.logo-text { font-size: 1.5rem; font-weight: 800; background: linear-gradient(90deg, var(--primary-dark), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Navbar Search */
.navbar-search { display: none; flex: 1; max-width: 22rem; margin: 0 1.5rem; position: relative; }
@media(min-width:1024px){ .navbar-search { display: flex; } }
.search-input { width: 100%; background: var(--slate-50); border: 1.5px solid var(--slate-200); border-radius: 1rem; padding: .625rem 1rem .625rem 2.75rem; font-size: .875rem; font-family: var(--font); color: var(--slate-800); outline: none; transition: border-color .2s, box-shadow .2s; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(96,165,250,.1); }
.search-icon { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--slate-400); width: 18px; height: 18px; pointer-events: none; }

/* Desktop nav */
.desktop-nav { display: none; align-items: center; gap: .25rem; }
@media(min-width:768px){ .desktop-nav { display: flex; } }
.nav-link { display: flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: .75rem; font-size: .875rem; font-weight: 600; color: var(--slate-600); transition: background .15s, color .15s; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover, .nav-link.active { background: rgba(96,165,250,.12); color: var(--primary-dark); }
.mobile-menu-btn { display: flex; align-items: center; padding: .5rem; color: var(--slate-600); border-radius: .75rem; transition: background .15s; }
.mobile-menu-btn svg { width: 28px; height: 28px; }
.mobile-menu-btn:hover { background: var(--slate-100); }
@media(min-width:768px){ .mobile-menu-btn { display: none; } }

/* ─── Mobile Drawer ─── */
.mobile-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); z-index: 100; }
.mobile-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 80%; max-width: 300px; background: #fff; border-left: 1px solid var(--slate-200); z-index: 110; padding: 1.5rem; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s; box-shadow: -8px 0 40px rgba(0,0,0,.12); }
.mobile-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.drawer-close { padding: .5rem; color: var(--slate-400); border-radius: .5rem; transition: background .15s, color .15s; }
.drawer-close:hover { background: var(--slate-100); color: var(--slate-600); }
.drawer-close svg { width: 24px; height: 24px; }
.drawer-search { position: relative; margin-bottom: 2rem; }
.drawer-search .search-input { background: var(--slate-50); border-radius: .75rem; padding: .75rem 1rem .75rem 2.75rem; }
.drawer-nav { display: flex; flex-direction: column; gap: .5rem; }
.drawer-link { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 1rem; font-size: 1.125rem; font-weight: 700; color: var(--slate-600); transition: background .15s, color .15s; }
.drawer-link svg { width: 22px; height: 22px; }
.drawer-link:hover { background: var(--slate-50); }
.drawer-link.active { background: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.3); }

/* ─── Main content ─── */
.main-content { flex: 1; max-width: 72rem; margin: 0 auto; width: 100%; padding: 2rem 1rem; }

/* ─── Footer ─── */
.footer { background: var(--slate-50); border-top: 1px solid var(--slate-200); padding: 3rem 0; margin-top: 3rem; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }
@media(min-width:768px){ .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-brand { font-size: 1.25rem; font-weight: 700; color: var(--slate-800); display: block; }
.footer-tagline { color: var(--slate-500); margin-top: .25rem; max-width: 28rem; font-size: .875rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; font-size: .875rem; font-weight: 500; color: var(--slate-600); }
.footer-links a, .footer-links button { cursor: pointer; color: var(--slate-600); font-size: .875rem; font-weight: 500; font-family: var(--font); background: none; border: none; transition: color .15s; }
.footer-links a:hover, .footer-links button:hover { color: var(--primary-dark); }
.footer-copy { border-top: 1px solid var(--slate-200); margin-top: 2rem; padding-top: 2rem; text-align: center; font-size: .75rem; color: var(--slate-400); }

/* ─── Cards ─── */
.card { background: #fff; border: 1.5px solid #eff6ff; border-radius: var(--radius-card); padding: 1.5rem; display: flex; flex-direction: column; height: 100%; transition: box-shadow .3s, transform .3s; }
.card:hover { box-shadow: 0 12px 32px rgba(59,130,246,.1); transform: translateY(-4px); }
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:768px){ .card-grid { grid-template-columns: repeat(2,1fr); } }
@media(min-width:1024px){ .card-grid { grid-template-columns: repeat(3,1fr); } }
.card-badge { display: inline-block; background: rgba(96,165,250,.1); color: var(--primary-dark); padding: .25rem .75rem; border-radius: 9999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--slate-800); margin: .75rem 0 .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { font-size: .875rem; color: var(--slate-500); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 1rem; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--slate-50); margin-top: auto; }
.author-row { display: flex; align-items: center; gap: .5rem; }
.author-avatar { width: 2rem; height: 2rem; border-radius: 9999px; border: 2px solid #fff; object-fit: cover; }
.author-name { font-size: .75rem; font-weight: 600; color: var(--slate-700); }
.card-date { font-size: .7rem; font-weight: 700; color: var(--slate-400); background: var(--slate-50); padding: .25rem .625rem; border-radius: .5rem; }

/* ─── Hero ─── */
.hero { position: relative; overflow: hidden; background: rgba(96,165,250,.05); border-radius: var(--radius-hero); padding: 4rem 1.5rem; text-align: center; border: 1.5px solid rgba(96,165,250,.08); }
@media(min-width:768px){ .hero { padding: 6rem 2rem; } }
.hero-blob-1 { position: absolute; top: 0; left: 0; width: 16rem; height: 16rem; background: rgba(96,165,250,.12); border-radius: 50%; filter: blur(60px); transform: translate(-50%,-50%); }
.hero-blob-2 { position: absolute; bottom: 0; right: 0; width: 20rem; height: 20rem; background: rgba(147,197,253,.18); border-radius: 50%; filter: blur(60px); transform: translate(25%,25%); }
.hero-inner { position: relative; z-index: 1; max-width: 56rem; margin: 0 auto; }
.hero-title { font-size: clamp(2.5rem,7vw,4.5rem); font-weight: 900; color: var(--slate-900); line-height: 1.1; letter-spacing: -.02em; }
.hero-highlight { color: var(--primary-dark); position: relative; display: inline-block; }
.hero-subtitle { font-size: clamp(1rem,2vw,1.25rem); color: var(--slate-500); margin-top: 2rem; max-width: 40rem; margin-left: auto; margin-right: auto; line-height: 1.7; font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; margin-top: 2.5rem; }

/* ─── Buttons ─── */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--primary-dark); color: #fff; padding: 1rem 2rem; border-radius: 1rem; font-weight: 700; font-size: .925rem; font-family: var(--font); transition: background .2s, transform .15s; box-shadow: var(--shadow-primary); cursor: pointer; border: none; }
.btn-primary:hover { background: #2563eb; transform: scale(1.03); }
.btn-primary:active { transform: scale(.97); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: #fff; color: var(--slate-700); padding: 1rem 2rem; border-radius: 1rem; font-weight: 700; font-size: .925rem; font-family: var(--font); border: 1.5px solid var(--slate-200); transition: background .2s, transform .15s; box-shadow: var(--shadow-card); cursor: pointer; }
.btn-secondary:hover { background: var(--slate-50); transform: scale(1.03); }

/* ─── Skeleton loading ─── */
.skeleton { background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; border-radius: var(--radius-card); }
@keyframes skeleton-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-card { height: 12rem; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 5rem 1rem; background: #fff; border-radius: var(--radius-card); border: 2px dashed var(--slate-200); }
.empty-state svg { width: 64px; height: 64px; color: var(--slate-200); margin: 0 auto 1rem; }
.empty-state p { color: var(--slate-500); }

/* ─── Section headers ─── */
.section-header { margin-bottom: 2rem; text-align: center; }
@media(min-width:768px){ .section-header { text-align: left; } }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--slate-800); }

/* ─── Resource Detail ─── */
.back-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--slate-500); font-weight: 500; margin-bottom: 2rem; transition: color .15s; }
.back-link:hover { color: var(--primary-dark); }
.back-link:hover svg { transform: translateX(-3px); }
.back-link svg { width: 20px; height: 20px; transition: transform .2s; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:1024px){ .detail-grid { grid-template-columns: 2fr 1fr; } }
.detail-card { background: #fff; border: 1.5px solid #bfdbfe55; border-radius: var(--radius-hero); padding: 2rem; }
@media(min-width:768px){ .detail-card { padding: 3rem; } }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.5rem 0; padding: 1rem 0; border-top: 1px solid var(--slate-50); border-bottom: 1px solid var(--slate-50); color: var(--slate-500); }
.detail-meta-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.detail-meta-item svg { width: 18px; height: 18px; color: var(--primary); }
.detail-author { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.detail-author-avatar { width: 3rem; height: 3rem; border-radius: 9999px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.detail-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.tag-chip { background: var(--slate-50); color: var(--slate-500); padding: .25rem .75rem; border-radius: .75rem; font-size: .875rem; border: 1px solid var(--slate-100); }

/* Sidebar action card */
.action-card { background: var(--primary-dark); color: #fff; border-radius: 1.75rem; padding: 2rem; box-shadow: var(--shadow-primary); position: sticky; top: 6rem; }
.action-btn-white { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; background: #fff; color: var(--primary-dark); font-weight: 700; padding: 1rem; border-radius: 1rem; transition: transform .15s; margin-bottom: .75rem; font-family: var(--font); border: none; cursor: pointer; font-size: .95rem; }
.action-btn-white:hover { transform: scale(1.02); }
.action-btn-ghost { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; background: rgba(255,255,255,.15); color: #fff; font-weight: 700; padding: 1rem; border-radius: 1rem; transition: background .15s; border: 1px solid rgba(255,255,255,.2); font-family: var(--font); cursor: pointer; font-size: .95rem; }
.action-btn-ghost:hover { background: rgba(255,255,255,.25); }
.action-trust { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: .75rem; }
.action-trust-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: rgba(219,234,254,.8); }
.action-trust-item svg { width: 16px; height: 16px; }

/* ─── About cards ─── */
.about-card { background: #fff; padding: 2rem; border-radius: var(--radius-hero); border: 1px solid var(--slate-100); transition: box-shadow .3s, transform .3s; }
.about-card:hover { box-shadow: 0 12px 32px rgba(59,130,246,.1); transform: translateY(-4px); }
.about-icon { background: var(--blue-50); width: 3rem; height: 3rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; color: var(--primary-dark); margin-bottom: 1.5rem; }
.about-icon svg { width: 24px; height: 24px; }

/* ─── Category page ─── */
.cat-card { background: #fff; padding: 2rem; border-radius: 3rem; border: 1px solid var(--slate-100); display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; transition: box-shadow .3s, transform .3s, border-color .2s; }
.cat-card:hover { box-shadow: 0 12px 32px rgba(59,130,246,.1); transform: translateY(-4px); border-color: rgba(96,165,250,.3); }
.cat-icon { background: var(--slate-50); padding: 1.25rem; border-radius: 1.75rem; color: var(--primary-dark); transition: background .2s, color .2s, transform .2s; display: flex; }
.cat-icon svg { width: 32px; height: 32px; }
.cat-card:hover .cat-icon { background: var(--primary-dark); color: #fff; transform: scale(1.1); }
.cat-name { font-size: 1.5rem; font-weight: 700; color: var(--slate-900); margin-bottom: .5rem; }
.cat-desc { color: var(--slate-500); line-height: 1.6; font-weight: 500; }

/* ─── FAQ ─── */
.faq-item { background: #fff; border: 1px solid var(--slate-100); border-radius: 1.5rem; overflow: hidden; margin-bottom: 1rem; }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; text-align: left; width: 100%; font-weight: 700; color: var(--slate-700); cursor: pointer; font-family: var(--font); font-size: 1rem; background: none; border: none; transition: background .15s; }
.faq-question:hover { background: var(--slate-50); }
.faq-question svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--slate-400); transition: transform .3s; }
.faq-question.open svg { color: var(--primary-dark); transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s; }
.faq-answer.open { max-height: 500px; }
.faq-answer-inner { padding: 0 1.5rem 1.5rem; color: var(--slate-500); border-top: 1px solid var(--slate-50); margin-top: .5rem; line-height: 1.7; }

/* ─── Forms (shared) ─── */
.form-label { display: block; font-size: .7rem; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; padding: 0 .25rem; }
.form-input { width: 100%; background: var(--slate-50); border: 1.5px solid var(--slate-200); border-radius: .75rem; padding: .75rem 1rem; font-size: .875rem; font-family: var(--font); color: var(--slate-900); outline: none; transition: border-color .2s, box-shadow .2s; }
.form-input:focus { border-color: var(--primary-dark); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
textarea.form-input { resize: none; }
select.form-input { appearance: none; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(6px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: #fff; border-radius: 2.5rem; padding: 2.5rem; max-width: 32rem; width: 100%; position: relative; box-shadow: 0 24px 80px rgba(0,0,0,.15); }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; padding: .5rem; color: var(--slate-400); border-radius: .5rem; transition: background .15s; }
.modal-close:hover { background: var(--slate-100); color: var(--slate-600); }
.modal-close svg { width: 20px; height: 20px; }

/* ─── Admin Layout ─── */
.admin-body { background: var(--slate-50); min-height: 100vh; display: flex; flex-direction: row; align-items: stretch; font-family: var(--font); width: 100%; }
.admin-sidebar { background: #1e293b; color: #fff; width: 16rem; flex-shrink: 0; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; transition: width .3s; overflow: hidden; }
@media(min-width:1024px) {
  .admin-sidebar { height: 100vh; }
}
.admin-sidebar.collapsed { width: 5rem; }
.sidebar-logo { height: 5rem; display: flex; align-items: center; padding: 0 1.5rem; border-bottom: 1px solid rgba(255,255,255,.05); gap: .75rem; flex-shrink: 0; overflow: hidden; }
.sidebar-logo svg { color: #60a5fa; width: 32px; height: 32px; flex-shrink: 0; }
.sidebar-logo-text { font-weight: 700; font-size: 1.25rem; white-space: nowrap; }
.sidebar-logo-badge { font-size: .65rem; font-family: monospace; background: rgba(96,165,250,.15); color: #60a5fa; padding: .1rem .35rem; border-radius: .25rem; }
.sidebar-nav { flex: 1; padding: 1.5rem .75rem; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: .75rem; color: #94a3b8; transition: background .15s, color .15s; font-weight: 500; font-size: .95rem; position: relative; white-space: nowrap; }
.sidebar-link svg { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-link.active { background: #2563eb; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.05); flex-shrink: 0; }
.sidebar-logout { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: .75rem; color: #94a3b8; width: 100%; font-weight: 500; font-family: var(--font); transition: background .15s, color .15s; cursor: pointer; background: none; border: none; font-size: .95rem; }
.sidebar-logout:hover { background: rgba(248,113,113,.1); color: #f87171; }
.sidebar-logout svg { width: 22px; height: 22px; flex-shrink: 0; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; overflow: hidden; }
.admin-topbar { position: sticky; top: 0; z-index: 10; height: 5rem; background: #fff; border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; flex-shrink: 0; gap: 1rem; }
.admin-topbar-search { flex: 1; max-width: 28rem; position: relative; }
.admin-topbar-search .search-input { background: var(--slate-50); border-radius: .75rem; padding: .625rem 1rem .625rem 2.5rem; }
.admin-topbar-search .search-icon { left: .75rem; }
.admin-content { flex: 1; overflow-y: auto; padding: 1rem; }
.admin-content-inner { max-width: 80rem; margin: 0 auto; }
#sidebarLogoText { display: none; } 
#adminMenuBtn {display: inline-block; }
@media(min-width:640px){#sidebarLogoText { display: inline-block; }}
@media(min-width:1024px){#adminMenuBtn { display: none; }}


/* Admin breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--slate-500); margin-top: .25rem; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb-current { font-weight: 500; color: var(--slate-900); }

/* Admin stats */
.stats-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:640px){ .stats-grid { grid-template-columns: repeat(2,1fr); }}
@media(min-width:1024px){ .stats-grid { grid-template-columns: repeat(4,1fr); } }
.stat-card { background: #fff; padding: 1.5rem; border-radius: 1.5rem; border: 1px solid var(--slate-200); box-shadow: var(--shadow-card); }
.stat-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.stat-icon { padding: .75rem; border-radius: 1rem; display: flex; }
.stat-trend { display: flex; align-items: center; gap: .25rem; font-size: .65rem; font-weight: 700; color: #059669; background: #d1fae5; padding: .2rem .5rem; border-radius: 9999px; }
.stat-trend svg { width: 12px; height: 12px; }
.stat-label { font-size: .65rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .1em; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--slate-900); margin-top: .25rem; }

/* Admin tables */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table thead tr { background: rgba(248,250,252,.5); }
.admin-table th { padding: 1rem 1.5rem; font-size: .65rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .1em; }
.admin-table td { padding: 1rem 1.5rem; border-top: 1px solid var(--slate-50); font-size: .875rem; }
.admin-table tr:hover td { background: rgba(239,246,255,.4); }
.table-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.tbl-btn { padding: .4rem .75rem; border-radius: .5rem; font-size: .75rem; font-weight: 600; font-family: var(--font); cursor: pointer; transition: background .15s; border: none; display: inline-flex; align-items: center; gap: .3rem; }
.tbl-btn svg { width: 14px; height: 14px; }
.tbl-btn-view { background: var(--blue-50); color: var(--primary-dark); }
.tbl-btn-view:hover { background: rgba(59,130,246,.15); }
.tbl-btn-delete { background: #fef2f2; color: #dc2626; }
.tbl-btn-delete:hover { background: #fee2e2; }

/* Activity timeline */
.activity-item { display: flex; gap: 1rem; }
.activity-dot-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.activity-dot { width: .75rem; height: .75rem; border-radius: 50%; margin-top: .375rem; }
.activity-line { width: 1px; flex: 1; background: var(--slate-100); margin: .25rem 0; }
.activity-title { font-size: .875rem; font-weight: 700; color: var(--slate-800); }
.activity-detail { font-size: .75rem; color: var(--slate-500); margin-top: .125rem; }
.activity-time { font-size: .65rem; color: var(--slate-400); margin-top: .25rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }

/* Admin form panels */
.panel { background: #fff; padding: 2rem; border-radius: 1.5rem; border: 1px solid var(--slate-200); box-shadow: var(--shadow-card); margin-bottom: 1.5rem; }
.panel-title { font-size: 1.1rem; font-weight: 700; color: var(--slate-900); }
.panel-subtitle { font-size: .75rem; color: var(--slate-400); font-weight: 500; margin-top: .25rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media(min-width:768px){ .form-grid-2 { grid-template-columns: repeat(2,1fr); }  }
.sidebar-logo-img { width: 36px; height: 36px;}

/* File upload zone */
.upload-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed var(--slate-200); border-radius: 1rem; padding: 2.5rem; cursor: pointer; transition: border-color .2s, background .2s; }
.upload-zone:hover, .upload-zone.has-file { border-color: var(--primary-dark); background: rgba(59,130,246,.03); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { width: 3.5rem; height: 3.5rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; background: var(--slate-100); color: var(--slate-300); margin-bottom: 1rem; transition: background .2s, color .2s; }
.upload-zone.has-file .upload-icon { background: var(--primary-dark); color: #fff; }
.upload-icon svg { width: 28px; height: 28px; }
.upload-label { font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.upload-size { font-size: .65rem; color: var(--slate-400); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }

/* Admin login */
.admin-login-wrap { min-height: 100vh; background: var(--slate-50); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.admin-login-box { max-width: 26rem; width: 100%; }
.login-logo { width: 4rem; height: 4rem; background: var(--slate-900); border-radius: 1.5rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; box-shadow: 0 8px 24px rgba(15,23,42,.2); }
.login-logo svg { width: 32px; height: 32px; color: #60a5fa; }
.login-card { background: #fff; padding: 2.5rem; border-radius: 2.5rem; border: 1px solid var(--slate-200); box-shadow: 0 12px 40px rgba(0,0,0,.07); }
.login-input-wrap { position: relative; }
.login-input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--slate-300); width: 20px; height: 20px; transition: color .2s; }
.login-input { width: 100%; background: var(--slate-50); border: 1.5px solid var(--slate-200); border-radius: 1rem; padding: 1rem 1rem 1rem 3rem; font-size: .95rem; font-family: var(--font); outline: none; transition: border-color .2s, box-shadow .2s; }
.login-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,.1); }
.login-input:focus + .login-input-icon { color: #3b82f6; }
.login-btn { width: 100%; background: var(--slate-900); color: #fff; font-weight: 700; padding: 1rem; border-radius: 1rem; border: none; font-family: var(--font); font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; cursor: pointer; transition: background .2s; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.login-btn:hover { background: #334155; }
.login-btn svg { width: 16px; height: 16px; }
.login-error { background: #fef2f2; color: #dc2626; padding: 1rem; border-radius: 1rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border: 1px solid #fecaca; display: flex; align-items: center; gap: .75rem; }
.login-error svg { width: 16px; height: 16px; flex-shrink: 0; }
.demo-hint { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--slate-50); text-align: center; }

/* Alerts */
.alert-success { display: flex; align-items: center; gap: .5rem; background: #ecfdf5; color: #059669; padding: 1rem; border-radius: .75rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border: 1px solid #a7f3d0; }
.alert-error { display: flex; align-items: center; gap: .5rem; background: #fef2f2; color: #dc2626; padding: 1rem; border-radius: .75rem; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border: 1px solid #fecaca; }
.alert-success svg, .alert-error svg { width: 14px; height: 14px; flex-shrink: 0; }

.success-msg { color: #059669; font-size: .875rem; font-weight: 600; padding: .75rem 0; }
.error-msg   { color: #dc2626;  font-size: .875rem; font-weight: 600; padding: .75rem 0; }

/* Utilities */
.hidden   { display: none !important; }
.w-full   { width: 100%; }
.space-y-16 > * + * { margin-top: 4rem; }
.space-y-12 > * + * { margin-top: 3rem; }
.space-y-8  > * + * { margin-top: 2rem; }
.space-y-6  > * + * { margin-top: 1.5rem; }
.space-y-4  > * + * { margin-top: 1rem; }
.space-y-5  > * + * { margin-top: 1.25rem; }
.text-center { text-align: center; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.text-2xl    { font-size: 1.5rem; }
.text-3xl    { font-size: 1.875rem; }
.text-4xl    { font-size: 2.25rem; }
.text-xl     { font-size: 1.25rem; }
.text-lg     { font-size: 1.125rem; }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-slate-800 { color: var(--slate-800); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-400 { color: var(--slate-400); }
.text-primary   { color: var(--primary-dark); }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pb-20 { padding-bottom: 5rem; }
.max-w-3xl { max-width: 48rem; margin-left: auto; margin-right: auto; }
.max-w-4xl { max-width: 56rem; margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; margin-left: auto; margin-right: auto; }

/* Resources + categories page grids */
.categories-header { text-align: center; max-width: 42rem; margin: 0 auto 3rem; }
.categories-header h1 { font-size: clamp(2rem,5vw,3rem); font-weight: 900; color: var(--slate-900); letter-spacing: -.02em; }
.categories-header p { font-size: 1.1rem; color: var(--slate-500); font-weight: 500; margin-top: 1rem; }

/* Filter bar */
.filter-bar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media(min-width:768px){ .filter-bar { flex-direction: row; align-items: center; justify-content: space-between; } }
.filter-bar-title h1 { font-size: 1.875rem; font-weight: 700; color: var(--slate-800); }
.filter-bar-title p  { color: var(--slate-500); }
.filter-search-wrap { flex: 1; max-width: 28rem; position: relative; }
.filter-search-wrap .search-input { background: #fff; border-radius: 1rem; padding: .75rem 1rem .75rem 2.75rem; box-shadow: var(--shadow-card); }
.filter-search-wrap .search-icon { left: .875rem; }

/* Admin category filter row */
.cat-filter-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-filter-btn { padding: .375rem .875rem; border-radius: .75rem; font-size: .75rem; font-weight: 600; font-family: var(--font); background: var(--slate-100); color: var(--slate-600); border: none; cursor: pointer; transition: background .15s, color .15s; }
.cat-filter-btn.active, .cat-filter-btn:hover { background: var(--primary-dark); color: #fff; }

/* Prose pages (Privacy, Terms) */
.prose-page { background: #fff; padding: 2rem; border-radius: 3rem; border: 1.5px solid #eff6ff; box-shadow: var(--shadow-card); max-width: 56rem; margin: 0 auto; }
@media(min-width:768px){ .prose-page { padding: 4rem; } }
.prose-page h1 { font-size: 1.875rem; font-weight: 700; color: var(--slate-800); margin-bottom: 2rem; }
.prose-page h2 { font-size: 1.25rem; font-weight: 700; color: var(--slate-700); margin: 2rem 0 .75rem; }
.prose-page p { color: var(--slate-600); line-height: 1.75; margin-bottom: 1rem; }
.prose-date { color: var(--slate-500); margin-bottom: 1.5rem; }
.prose-note { background: var(--blue-50); padding: 1.5rem; border-radius: 1rem; border: 1px solid #bfdbfe; margin-top: 3rem; color: #1d4ed8; font-size: .875rem; font-style: italic; }

/* Resource admin view */
.resource-view-meta { display: flex; flex-wrap: wrap; gap: 1rem; }
.meta-badge { background: var(--slate-100); color: var(--slate-700); padding: .375rem .875rem; border-radius: .75rem; font-size: .8rem; font-weight: 600; }

/* Sidebar collapsed tooltip */
.sidebar-tooltip { display: none; position: absolute; left: calc(100% + 1rem); background: var(--slate-900); color: #fff; padding: .25rem .625rem; border-radius: .375rem; font-size: .75rem; white-space: nowrap; pointer-events: none; z-index: 100; }
.admin-sidebar.collapsed .sidebar-link:hover .sidebar-tooltip { display: block; }
.admin-sidebar.collapsed .sidebar-logo-text,
.admin-sidebar.collapsed .sidebar-link span { display: none; }

/* Mobile admin */
@media(max-width:1023px){
  .admin-sidebar { position: fixed; left: 0; top: 0; z-index: 70; transform: translateX(-100%); width: 16rem !important; }
  .admin-sidebar.mobile-open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.2); }
  .admin-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); z-index: 60; display: none; }
  .admin-overlay.visible { display: block; }
}
