/* ============================================================
   AskitOn Design System
   ============================================================ */

/* --- Variables --- */
:root {
  --accent: #0284c7;
  --accent-h: #0ea5e9;
  --accent-l: #e0f2fe;
  --accent-rgb: 2,132,199;
  --gold: #d97706;
  --gold-l: #fef3c7;
  --success: #059669;
  --success-l: #d1fae5;
  --danger: #dc2626;
  --danger-l: #fee2e2;
  --warning: #ea580c;
  --warning-l: #fff7ed;
  --bg: #eef6fc;
  --bg-2: #ffffff;
  --bg-3: #f0f9ff;
  --surface: #ffffff;
  --surface-2: #f0f9ff;
  --border: #dbeafe;
  --border-2: #bae0fb;
  --text: #0b2540;
  --text-2: #2f5170;
  --text-3: #5d7894;
  --text-4: #94aec8;
  --shadow: 0 1px 3px rgba(2,76,140,.08), 0 1px 2px rgba(2,76,140,.05);
  --shadow-lg: 0 10px 15px -3px rgba(2,76,140,.12), 0 4px 6px -4px rgba(2,76,140,.06);
  --shadow-xl: 0 20px 25px -5px rgba(2,76,140,.16), 0 8px 10px -6px rgba(2,76,140,.08);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --hdr-h: 64px;
  --mnav-h: 64px;
  --sidebar-w: 260px;
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
}

[data-theme="dark"] {
  --accent: #38bdf8;
  --accent-h: #7dd3fc;
  --accent-l: #0c2d48;
  --gold: #f59e0b;
  --gold-l: #1c1917;
  --success-l: #052e16;
  --danger-l: #1c0a0a;
  --warning-l: #1a0e05;
  --bg: #060d1a;
  --bg-2: #0a1628;
  --bg-3: #0d1b30;
  --surface: #0f1f38;
  --surface-2: #142847;
  --border: #1c3358;
  --border-2: #2d4a78;
  --text: #e6f1ff;
  --text-2: #a8c4e8;
  --text-3: #7593bc;
  --text-4: #4d6690;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.5);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-ui); font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-h); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; border: none; background: none; outline: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-ui); font-weight: 700; line-height: 1.25; color: var(--text); }
::selection { background: rgba(var(--accent-rgb),.15); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main { min-height: calc(100vh - var(--hdr-h) - 200px); padding: calc(var(--hdr-h) + 24px) 0 40px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width:768px) { .grid-3 { grid-template-columns: 260px 1fr; } }
@media (min-width:1080px) { .grid-3 { grid-template-columns: 260px 1fr 300px; } }
.hide-sm { display: none; }
@media (min-width:768px) { .hide-sm { display: inline; } }

/* --- Header --- */
.hdr { position: fixed; top: 0; left: 0; right: 0; height: var(--hdr-h); background: var(--surface); border-bottom: 1px solid var(--border); z-index: 100; backdrop-filter: blur(12px); background: rgba(255,255,255,.85); }
[data-theme="dark"] .hdr { background: rgba(19,28,49,.9); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.hdr__left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hdr__menu-btn { display: flex; padding: 6px; border-radius: 8px; color: var(--text-2); }
.hdr__menu-btn:hover { background: var(--bg); }
@media (min-width:768px) { .hdr__menu-btn { display: none; } }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo__text { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.logo__text em { font-style: normal; color: var(--accent); }
.hdr__search { position: relative; flex: 1; max-width: 460px; display: none; }
@media (min-width:768px) { .hdr__search { display: flex; align-items: center; } }
.hdr__search-ico { position: absolute; left: 14px; color: var(--text-4); pointer-events: none; }
.hdr__search-in { width: 100%; height: 42px; padding: 0 40px 0 42px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 14px; transition: all .2s var(--ease); }
.hdr__search-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); background: var(--bg-2); }
.hdr__search-in::placeholder { color: var(--text-4); }
.hdr__kbd { position: absolute; right: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-4); pointer-events: none; }
.hdr__nav { display: flex; align-items: center; gap: 4px; }
.hdr__link { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 600; color: var(--text-3); transition: all .2s var(--ease); white-space: nowrap; }
.hdr__link:hover { color: var(--text); background: var(--bg); }
.hdr__link.active { color: var(--accent); background: var(--accent-l); }
.hdr__ask { background: var(--accent); color: #fff !important; margin-left: 4px; }
.hdr__ask:hover { background: var(--accent-h); }
.badge-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }
.hdr__user { position: relative; }
.hdr__avatar-btn { display: flex; align-items: center; padding: 2px; border-radius: 50%; border: 2px solid transparent; transition: border-color .2s; }
.hdr__avatar-btn:hover { border-color: var(--accent); }
.hdr__auth { display: flex; gap: 8px; }

/* --- Avatar --- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-l); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 12px; }
.avatar--lg { width: 80px; height: 80px; font-size: 28px; }
.avatar--xl { width: 120px; height: 120px; font-size: 40px; }

/* --- Dropdown --- */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xl); padding: 6px; z-index: 200; animation: ddIn .15s var(--ease); }
@keyframes ddIn { from { opacity:0; transform: translateY(-8px); } }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); transition: all .15s; text-align: left; }
.dd-item:hover { background: var(--bg); color: var(--text); }
.dd-item--danger { color: var(--danger); }
.dd-item--danger:hover { background: var(--danger-l); }
.dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border-radius: var(--radius); transition: all .2s var(--ease); white-space: nowrap; cursor: pointer; }
.btn--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn--md { height: 42px; padding: 0 20px; font-size: 14px; }
.btn--lg { height: 48px; padding: 0 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn--outline { border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { color: var(--text-3); }
.btn--ghost:hover { color: var(--text); background: var(--bg); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; }
.btn--success { background: var(--success); color: #fff; }
.btn--icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; }
.btn--icon svg { flex-shrink: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn--full { width: 100%; }

/* --- Cards --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card:hover { box-shadow: var(--shadow-lg); }
.card__body { padding: 20px; }
.card__header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card__title { font-size: 15px; font-weight: 700; }

/* --- Question Card --- */
.qcard { padding: 20px; border-bottom: 1px solid var(--border); transition: background .15s; }
.qcard:last-child { border-bottom: none; }
.qcard:hover { background: var(--surface-2); }
.qcard__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-3); }
.qcard__cat { color: var(--accent); font-weight: 600; }
.qcard__title { font-size: 17px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; }
.qcard__title a { color: var(--text); }
.qcard__title a:hover { color: var(--accent); }
.qcard__body { font-family: var(--font-body); font-size: 15px; color: var(--text-2); line-height: 1.65; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qcard__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qcard__actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.qcard__action { display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-3); transition: all .15s; }
.qcard__action:hover { color: var(--accent); background: var(--accent-l); }
.qcard__action svg { width: 16px; height: 16px; }
.qcard__action--active { color: var(--accent); }
.qcard__votes { display: flex; align-items: center; gap: 2px; }
.vote-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); transition: all .15s; }
.vote-btn:hover { background: var(--bg); }
.vote-btn.up.active { color: var(--success); background: var(--success-l); }
.vote-btn.down.active { color: var(--danger); background: var(--danger-l); }
.vote-count { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }

/* --- Tags --- */
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; background: var(--accent-l); color: var(--accent); transition: all .15s; cursor: pointer; }
.tag:hover { background: var(--accent); color: #fff; }
.tag--sm { padding: 2px 8px; font-size: 11px; }

/* --- Badge --- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge--gold { background: var(--gold-l); color: var(--gold); }
.badge--green { background: var(--success-l); color: var(--success); }
.badge--blue { background: var(--accent-l); color: var(--accent); }
.badge--red { background: var(--danger-l); color: var(--danger); }

/* --- Sidebar --- */
.sidebar { position: sticky; top: calc(var(--hdr-h) + 24px); }
.sidebar__widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 20px; overflow: hidden; }
.sidebar__widget-hdr { padding: 16px 18px 12px; font-size: 14px; font-weight: 700; color: var(--text); border-bottom: 1px solid var(--border); }
.sidebar__widget-body { padding: 12px 18px 16px; }
.sidebar__link { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; font-weight: 500; color: var(--text-2); transition: color .15s; }
.sidebar__link:hover { color: var(--accent); }
.sidebar__link.active { color: var(--accent); font-weight: 700; }
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* --- Right Sidebar Items --- */
.trend-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.trend-item:last-child { border-bottom: none; }
.trend-item__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.trend-item__title a { color: inherit; }
.trend-item__title a:hover { color: var(--accent); }
.trend-item__meta { font-size: 12px; color: var(--text-4); }
.user-sug { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.user-sug__info { flex: 1; min-width: 0; }
.user-sug__name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sug__rep { font-size: 12px; color: var(--text-4); }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select { width: 100%; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: all .2s var(--ease); }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-4); }
.form-textarea { min-height: 120px; resize: vertical; font-family: var(--font-body); line-height: 1.65; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--text-4); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab { padding: 12px 20px; font-size: 14px; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Pagination --- */
.pager { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 24px; }
.pager__btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-3); transition: all .15s; }
.pager__btn:hover { background: var(--bg); color: var(--text); }
.pager__btn.active { background: var(--accent); color: #fff; }

/* --- Empty State --- */
.empty { text-align: center; padding: 60px 20px; }
.empty__icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty__desc { color: var(--text-3); font-size: 14px; max-width: 360px; margin: 0 auto 20px; }

/* --- Skeleton Loading --- */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skel 1.5s infinite; border-radius: 6px; }
@keyframes skel { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel-line { height: 16px; margin-bottom: 10px; }
.skel-line--lg { height: 22px; width: 80%; }
.skel-line--sm { height: 12px; width: 60%; }
.skel-circle { border-radius: 50%; }
.skel-card { padding: 20px; border-bottom: 1px solid var(--border); }

/* --- Toast --- */
.toasts { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xl); font-size: 14px; font-weight: 500; animation: toastIn .3s var(--ease-bounce); max-width: 380px; }
.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--accent); }
.toast.removing { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastIn { from { opacity:0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity:0; transform: translateX(40px); } }

/* --- Modal --- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; backdrop-filter: blur(4px); animation: fadeIn .2s; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 501; max-width: 600px; width: calc(100% - 40px); max-height: 85vh; overflow-y: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); animation: modalIn .25s var(--ease-bounce); }
.modal__body { padding: 28px; }
.modal__close { position: absolute; top: 16px; right: 16px; }
@keyframes fadeIn { from { opacity:0; } }
@keyframes modalIn { from { opacity:0; transform: translate(-50%,-48%); } }

/* --- Question Detail Page --- */
.q-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; }
.q-detail__title { font-size: 26px; font-weight: 800; line-height: 1.3; margin-bottom: 12px; }
.q-detail__meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); margin-bottom: 20px; flex-wrap: wrap; }
.q-detail__body { font-family: var(--font-body); font-size: 16px; line-height: 1.75; color: var(--text-2); }
.q-detail__body p { margin-bottom: 14px; }
.q-detail__body strong { font-weight: 600; color: var(--text); }
.q-detail__body code { font-family: var(--font-mono); font-size: 14px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.q-detail__body pre { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin-bottom: 14px; }
.q-detail__body pre code { background: none; padding: 0; }
.q-detail__body img { border-radius: var(--radius); margin: 14px 0; }
.q-detail__body ul, .q-detail__body ol { padding-left: 24px; margin-bottom: 14px; }
.q-detail__body li { margin-bottom: 6px; list-style: disc; }
.q-detail__body ol li { list-style: decimal; }
.q-detail__body blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-3); margin-bottom: 14px; font-style: italic; }
.q-detail__actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* --- Answer Card --- */
.ans { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; background: var(--surface); }
.ans--accepted { border-color: var(--success); background: var(--success-l); }
.ans__hdr { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ans__user { font-weight: 600; font-size: 14px; }
.ans__user a { color: var(--text); }
.ans__user a:hover { color: var(--accent); }
.ans__time { font-size: 12px; color: var(--text-4); }
.ans__body { font-family: var(--font-body); font-size: 15px; line-height: 1.7; color: var(--text-2); }
.ans__body p { margin-bottom: 12px; }
.ans__actions { display: flex; align-items: center; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ans__accepted-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-full); background: var(--success-l); color: var(--success); font-size: 12px; font-weight: 700; }

/* --- Comments --- */
.comments { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment__body { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.comment__author { font-weight: 600; color: var(--text); }
.comment__time { font-size: 11px; color: var(--text-4); margin-left: 8px; }
.comment-form { display: flex; gap: 10px; margin-top: 12px; }
.comment-form input { flex: 1; height: 36px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.comment-form input:focus { border-color: var(--accent); }

/* --- Profile Page --- */
.profile-cover { height: 200px; background: linear-gradient(135deg, var(--accent), #7c3aed); border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: relative; }
.profile-info { padding: 0 28px 28px; background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); margin-bottom: 24px; }
.profile-info__top { display: flex; gap: 20px; margin-top: -40px; align-items: flex-end; flex-wrap: wrap; }
.profile-info__name { font-size: 24px; font-weight: 800; margin-top: 16px; }
.profile-info__username { font-size: 14px; color: var(--text-3); }
.profile-info__bio { font-family: var(--font-body); color: var(--text-2); margin: 12px 0; font-size: 15px; line-height: 1.6; }
.profile-info__meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; margin-bottom: 16px; }
.profile-info__meta span { display: flex; align-items: center; gap: 5px; }
.profile-stats { display: flex; gap: 24px; margin-top: 16px; }
.profile-stat { text-align: center; }
.profile-stat__num { font-size: 20px; font-weight: 800; color: var(--text); }
.profile-stat__label { font-size: 12px; color: var(--text-4); }

/* --- Categories Grid --- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cat-card { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: all .2s var(--ease); cursor: pointer; }
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cat-card__icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cat-card__info { flex: 1; min-width: 0; }
.cat-card__name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.cat-card__count { font-size: 13px; color: var(--text-4); }

/* --- Auth Pages --- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--hdr-h) - 200px); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; box-shadow: var(--shadow-lg); }
.auth-card__title { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.auth-card__subtitle { text-align: center; color: var(--text-3); font-size: 14px; margin-bottom: 28px; }
.auth-card__divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; font-size: 13px; color: var(--text-4); }
.auth-card__divider::before, .auth-card__divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-card__footer { text-align: center; font-size: 14px; color: var(--text-3); margin-top: 24px; }

/* --- Notification Item --- */
.notif-item { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background .15s; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item--unread { background: var(--accent-l); }
.notif-item__icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__text { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.notif-item__text strong { color: var(--text); font-weight: 600; }
.notif-item__time { font-size: 12px; color: var(--text-4); margin-top: 4px; }

/* --- Settings --- */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
@media (max-width:767px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-nav { border-right: 1px solid var(--border); padding-right: 20px; }
.settings-nav a { display: block; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--text-3); margin-bottom: 4px; }
.settings-nav a.active { color: var(--accent); background: var(--accent-l); font-weight: 600; }
.settings-body { padding-left: 28px; }
@media (max-width:767px) { .settings-nav { border-right: none; padding-right: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; } .settings-body { padding-left: 0; } }

/* --- Admin Panel --- */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; min-height: 60vh; }
@media (max-width:767px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; position: sticky; top: calc(var(--hdr-h) + 24px); height: fit-content; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 500; color: var(--text-3); margin-bottom: 4px; }
.admin-sidebar a.active { color: var(--accent); background: var(--accent-l); font-weight: 600; }
.admin-sidebar a svg { width: 18px; height: 18px; }
.admin-content { min-width: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card__label { font-size: 13px; font-weight: 500; color: var(--text-4); margin-bottom: 4px; }
.stat-card__value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-card__change { font-size: 12px; margin-top: 4px; }
.stat-card__change--up { color: var(--success); }
.stat-card__change--down { color: var(--danger); }

/* --- Table --- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-4); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* --- Rich Text Toolbar --- */
.rte-toolbar { display: flex; gap: 2px; padding: 8px; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); flex-wrap: wrap; }
.rte-toolbar button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-3); transition: all .15s; }
.rte-toolbar button:hover { background: var(--bg); color: var(--text); }
.rte-toolbar button.active { background: var(--accent-l); color: var(--accent); }
.rte-editor { min-height: 180px; padding: 14px; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); font-family: var(--font-body); font-size: 15px; line-height: 1.7; outline: none; }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--text-4); pointer-events: none; }
.rte-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); }
.rte-editor p { margin-bottom: 10px; }

/* --- Static Pages --- */
.static-page { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 48px; }
@media (max-width:767px) { .static-page { padding: 28px; } }
.static-page h2 { font-size: 28px; margin-bottom: 20px; }
.static-page h3 { font-size: 20px; margin: 24px 0 12px; }
.static-page p { font-family: var(--font-body); font-size: 16px; line-height: 1.75; color: var(--text-2); margin-bottom: 14px; }
.static-page ul, .static-page ol { padding-left: 24px; margin-bottom: 14px; }
.static-page li { font-family: var(--font-body); font-size: 16px; line-height: 1.75; color: var(--text-2); margin-bottom: 6px; list-style: disc; }

/* --- Search Page --- */
.search-page__filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip { padding: 6px 14px; border-radius: var(--radius-full); border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text-3); transition: all .15s; cursor: pointer; }
.filter-chip:hover, .filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-l); }

/* --- Breadcrumbs --- */
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-4); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: var(--border-2); }

/* --- Share Buttons --- */
.share-row { display: flex; gap: 6px; }
.share-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-3); transition: all .15s; border: 1px solid var(--border); }
.share-btn:hover { color: #fff; }
.share-btn--wa:hover { background: #25d366; border-color: #25d366; }
.share-btn--fb:hover { background: #1877f2; border-color: #1877f2; }
.share-btn--tw:hover { background: #0f1419; border-color: #0f1419; }
.share-btn--li:hover { background: #0a66c2; border-color: #0a66c2; }
.share-btn--tg:hover { background: #0088cc; border-color: #0088cc; }
.share-btn--copy:hover { background: var(--accent); border-color: var(--accent); }

/* --- Footer --- */
.ftr { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 0; margin-top: 48px; }
.ftr__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width:767px) { .ftr__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width:479px) { .ftr__grid { grid-template-columns: 1fr; } }
.ftr__brand .logo { margin-bottom: 12px; }
.ftr__tag { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.ftr__desc { font-size: 14px; color: var(--text-3); line-height: 1.6; max-width: 300px; }
.ftr__h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text); margin-bottom: 16px; }
.ftr__col a { display: block; font-size: 14px; color: var(--text-3); padding: 4px 0; }
.ftr__col a:hover { color: var(--accent); }
.ftr__bottom { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-4); flex-wrap: wrap; gap: 12px; }
.ftr__actions { display: flex; align-items: center; gap: 12px; }
.ftr__admin-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-4); transition: all .15s; opacity: 0.5; cursor: pointer; }
.ftr__admin-btn:hover { color: var(--accent); background: var(--accent-l); opacity: 1; }

/* --- Theme Toggle --- */
.theme-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-3); transition: all .2s; position: relative; }
.theme-btn:hover { color: var(--gold); background: var(--gold-l); }
[data-theme="light"] .theme-btn__moon { display: none; }
[data-theme="dark"] .theme-btn__sun { display: none; }

/* --- Mobile Nav --- */
.mnav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--mnav-h); background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-around; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width:768px) { .mnav { display: none; } }
body { padding-bottom: var(--mnav-h); }
@media (min-width:768px) { body { padding-bottom: 0; } }
.mnav__link { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; font-size: 10px; font-weight: 600; color: var(--text-4); transition: color .15s; }
.mnav__link:hover, .mnav__link.active { color: var(--accent); }
.mnav__ask { width: 50px; height: 50px; border-radius: 50%; background: var(--accent); color: #fff !important; display: flex; align-items: center; justify-content: center; margin-top: -20px; box-shadow: var(--shadow-lg); }
.mnav__ask span { display: none; }

/* --- Page Loader --- */
.loader { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
.loader__spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-mono { font-family: var(--font-mono); }
.font-body { font-family: var(--font-body); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Page Transitions --- */
.page-enter { animation: pageIn .3s var(--ease); }
@keyframes pageIn { from { opacity:0; transform: translateY(12px); } }

/* --- Responsive --- */
@media (max-width:767px) {
  .hdr__search { display: none; }
  .ftr { padding: 32px 0 0; }
  .q-detail { padding: 20px; }
  .q-detail__title { font-size: 20px; }
  .auth-card { padding: 28px 20px; }
  .auth-card__title { font-size: 24px; }
}

/* --- Print --- */
@media print {
  .hdr, .mnav, .ftr, .toasts, .modal-bg, .modal { display: none !important; }
  .main { padding-top: 0 !important; }
  body { background: #fff; color: #000; }
}