/* ==========================================================================
   Primorexbd - Premium Design System
   Themes: dark (default) / light / system  |  Direction: LTR + RTL
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #060a13;
  --bg-soft: #0a1020;
  --surface: #0e1527;
  --surface-2: #131c33;
  --surface-3: #1a2542;
  --glass: rgba(14, 21, 39, .72);
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .28);
  --ink: #f3f6fc;
  --ink-strong: #ffffff;
  --ink-2: #a9b5ca;
  --ink-3: #7685a1;
  --brand: #5b86ff;
  --brand-600: #3f6df5;
  --brand-2: #22d3ee;
  --brand-soft: rgba(91, 134, 255, .14);
  --brand-line: rgba(91, 134, 255, .38);
  --link: #7aa2ff;
  --on-brand: #ffffff;
  --gold: #e8c872;
  --gold-soft: rgba(232, 200, 114, .14);
  --success: #2ecc8f;
  --success-soft: rgba(46, 204, 143, .14);
  --warning: #f5a524;
  --warning-soft: rgba(245, 165, 36, .14);
  --danger: #f4607a;
  --danger-soft: rgba(244, 96, 122, .14);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .14);
  --brand-grad: linear-gradient(135deg, #4f7cff 0%, #22d3ee 100%);
  --gold-grad: linear-gradient(135deg, #f4dc94 0%, #c99a3b 100%);
  --aurora: radial-gradient(60% 50% at 20% 0%, rgba(79,124,255,.22) 0%, transparent 70%),
            radial-gradient(50% 45% at 85% 5%, rgba(34,211,238,.14) 0%, transparent 70%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
  --shadow-glow: 0 10px 30px -8px rgba(79,124,255,.55);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --header-h: 68px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font-latin: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-latin);
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f3f6fc;
  --surface-3: #e8eef9;
  --glass: rgba(255, 255, 255, .78);
  --line: rgba(15, 23, 42, .09);
  --line-strong: rgba(15, 23, 42, .18);
  --ink: #0f1a30;
  --ink-strong: #060d1d;
  --ink-2: #4a5873;
  --ink-3: #75839d;
  --brand: #2f5df0;
  --brand-600: #234ad0;
  --brand-2: #0891b2;
  --brand-soft: rgba(47, 93, 240, .09);
  --brand-line: rgba(47, 93, 240, .35);
  --link: #2551d8;
  --gold: #a87a16;
  --gold-soft: rgba(168, 122, 22, .12);
  --success: #12935f;
  --success-soft: rgba(18, 147, 95, .11);
  --warning: #b86e00;
  --warning-soft: rgba(184, 110, 0, .12);
  --danger: #d1304a;
  --danger-soft: rgba(209, 48, 74, .1);
  --info: #0b78b0;
  --info-soft: rgba(11, 120, 176, .1);
  --brand-grad: linear-gradient(135deg, #2f5df0 0%, #0aa5c7 100%);
  --aurora: radial-gradient(60% 50% at 15% 0%, rgba(47,93,240,.12) 0%, transparent 70%),
            radial-gradient(50% 45% at 90% 5%, rgba(8,145,178,.09) 0%, transparent 70%);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 12px 28px -12px rgba(15,23,42,.18);
  --shadow-lg: 0 30px 60px -24px rgba(15,23,42,.28);
  --shadow-glow: 0 10px 28px -8px rgba(47,93,240,.4);
}
/* Legacy aliases so every older view keeps working in both themes */
:root, html[data-theme="light"] {
  --bg-base: var(--bg);
  --bg-surface: var(--surface);
  --bg-surface-elevated: var(--surface-2);
  --border-color: var(--line);
  --border-hover: var(--brand-line);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --accent-primary: var(--brand);
  --accent-glow: var(--link);
  --accent-gradient: var(--brand-grad);
  --badge-success: var(--success);
  --badge-warning: var(--warning);
  --badge-danger: var(--danger);
  --admin-bg-base: var(--bg);
  --admin-bg-surface: var(--surface);
  --admin-bg-card: var(--surface-2);
  --admin-border: var(--line);
  --admin-border-hover: var(--brand-line);
  --admin-text-main: var(--ink);
  --admin-text-muted: var(--ink-3);
  --admin-text-sub: var(--ink-2);
  --admin-accent: var(--brand);
  --admin-glow: var(--link);
  --admin-success: var(--success);
  --admin-warning: var(--warning);
  --admin-danger: var(--danger);
}
html[lang="bn"] { --font-body: 'Hind Siliguri', var(--font-latin); }
html[lang="hi"] { --font-body: 'Noto Sans Devanagari', var(--font-latin); }
html[lang="ar"], html[lang="ur"] { --font-body: 'Noto Sans Arabic', var(--font-latin); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--aurora);
}
a { color: inherit; text-decoration: none; transition: color .2s, background-color .2s, border-color .2s, opacity .2s, transform .2s var(--ease); }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 1.25rem; }
.container-fluid { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -0.2em; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }
.text-gradient { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-gold { color: var(--gold); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }

/* ---------- 3. Buttons ---------- */
.btn, .admin-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .66rem 1.25rem; border-radius: 999px; font-size: .875rem; font-weight: 650;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; line-height: 1.2;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:active, .admin-btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .admin-btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-primary, .admin-btn-primary { background: var(--brand-grad); color: var(--on-brand); box-shadow: var(--shadow-glow); }
.btn-primary:hover, .admin-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -8px rgba(79,124,255,.6); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--link); background: var(--brand-soft); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-gold { background: var(--gold-grad); color: #2a1d02; box-shadow: 0 10px 28px -10px rgba(201,154,59,.6); }
.btn-danger, .admin-btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover, .admin-btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: .42rem .9rem; font-size: .78rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); position: relative;
}
.icon-btn:hover { color: var(--ink); border-color: var(--brand-line); background: var(--brand-soft); }
.icon-btn .dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface-2); }

/* ---------- 4. Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 650; margin-bottom: .4rem; color: var(--ink); }
.form-hint { font-size: .76rem; color: var(--ink-3); margin-top: .3rem; }
.form-control, .field, select.form-control, textarea.form-control {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: .78rem 1rem; color: var(--ink); font-size: .92rem; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control::placeholder { color: var(--ink-3); }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237685a1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-inline-end: 2.4rem; }
[dir="rtl"] select.form-control { background-position: left .9rem center; }
.input-group { position: relative; }
.input-group .form-control { padding-inline-start: 2.8rem; }
.input-group > .icon { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.input-group .toggle-pass { position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-3); padding: .5rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 17px; height: 17px; }
.field-error { color: var(--danger); font-size: .78rem; margin-top: .3rem; }

/* ---------- 5. Cards, tables, badges, alerts ---------- */
.card, .content-card, .admin-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm); position: relative;
}
.card-header-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft); filter: blur(18px); }
.kpi-label { font-size: .78rem; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: .45rem; margin-bottom: .55rem; }
.kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-strong); }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--link); display: inline-flex; align-items: center; justify-content: center; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; text-align: start; }
th { padding: .8rem 1rem; color: var(--ink-3); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; text-align: start; }
td { padding: .95rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--surface-2); color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
.status-badge, .badge, .badge-pill {
  display: inline-flex; align-items: center; gap: .35rem; padding: .26rem .7rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.status-badge::before, .badge:not(.badge-pill)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pill { background: var(--brand-soft); color: var(--link); border: 1px solid var(--brand-line); }
.status-completed, .status-paid, .status-active, .status-approved, .status-credit, .badge-completed, .badge-paid, .badge-active, .badge-approved, .badge-success { background: var(--success-soft); color: var(--success); }
.status-pending_payment, .status-pending, .status-warning, .badge-pending_payment, .badge-pending, .badge-warning { background: var(--warning-soft); color: var(--warning); }
.status-processing, .status-queued, .status-open, .status-info, .badge-processing, .badge-queued, .badge-open, .badge-info { background: var(--info-soft); color: var(--info); }
.status-failed, .status-danger, .status-rejected, .status-cancelled, .status-suspended, .status-refunded, .badge-failed, .badge-danger, .badge-rejected, .badge-cancelled, .badge-suspended, .badge-refunded { background: var(--danger-soft); color: var(--danger); }
.alert, .alert-box { display: flex; gap: .75rem; align-items: flex-start; padding: .95rem 1.15rem; border-radius: var(--radius-md); margin-bottom: 1.25rem; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); border-color: var(--success); color: var(--ink); }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--ink); }
.alert-info { background: var(--info-soft); border-color: var(--info); color: var(--ink); }
.alert .icon { margin-top: .15rem; }
.alert-success .icon { color: var(--success); } .alert-error .icon, .alert-danger .icon { color: var(--danger); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-3); }
.empty-state .icon { width: 42px; height: 42px; margin: 0 auto .75rem; opacity: .6; }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; color: var(--ink-2); font-weight: 600; }
.code-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem 1.2rem; font-family: var(--font-mono); font-size: .82rem; overflow-x: auto; color: var(--ink); direction: ltr; text-align: left; }
.pager { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
.pager a, .pager span { padding: .45rem .85rem; border-radius: 10px; border: 1px solid var(--line); font-size: .82rem; background: var(--surface); }
.pager .active, .pager span[aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); }
nav[role="navigation"] svg { width: 18px; display: inline; }

/* ---------- 6. Header / dropdowns / drawer ---------- */
.navbar, .app-header, .admin-nav {
  background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 90; height: var(--header-h);
}
.nav-content, .header-content, .admin-nav-inner, .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 100%; }
.brand-logo, .brand, .admin-brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--ink-strong); }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-grad); display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-glow); }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-sub { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); display: block; line-height: 1; margin-top: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.nav-links { display: flex; align-items: center; gap: .15rem; }
.nav-link { padding: .5rem .85rem; border-radius: 10px; font-size: .88rem; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: .45rem; }
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.search-form { flex: 1; max-width: 460px; position: relative; }
.search-input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .66rem 1.1rem; padding-inline-start: 2.8rem; font-size: .875rem; outline: none; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
.search-icon { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; width: 17px; height: 17px; }
.dropdown { position: relative; }
.menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); min-width: 210px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 16px; padding: .45rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .18s, transform .22s var(--ease), visibility .18s; z-index: 120; transform-origin: top right;
}
[dir="rtl"] .menu { transform-origin: top left; }
.dropdown.open .menu { opacity: 1; visibility: visible; transform: none; }
.menu-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .6rem .8rem; border-radius: 10px; font-size: .86rem; font-weight: 600; color: var(--ink-2); background: none; border: 0; text-align: start; }
.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu-item.is-active { color: var(--link); background: var(--brand-soft); }
.menu-item .check { margin-inline-start: auto; opacity: 0; color: var(--brand); }
.menu-item.is-active .check { opacity: 1; }
.menu-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: .5rem .8rem .3rem; font-weight: 700; }
.menu-sep { height: 1px; background: var(--line); margin: .35rem .2rem; }
.theme-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.theme-switch button { width: 34px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--link); box-shadow: var(--shadow-sm); }
.lang-current { font-size: .8rem; font-weight: 700; }
.burger { display: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(2,6,15,.6); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: .25s; z-index: 140; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(86vw, 340px); background: var(--surface); border-inline-end: 1px solid var(--line-strong);
  z-index: 150; transform: translateX(-102%); transition: transform .35s var(--ease); display: flex; flex-direction: column; padding: 1.1rem; overflow-y: auto;
}
[dir="rtl"] .drawer { transform: translateX(102%); }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.drawer .nav-link, .drawer .side-link { width: 100%; padding: .8rem .9rem; font-size: .95rem; }
.drawer-foot { margin-top: auto; padding-top: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.mobile-search { display: none; padding: .6rem 1.25rem .75rem; border-top: 1px solid var(--line); }

/* Mobile bottom tab bar */
.bottom-nav { display: none; }

/* ---------- 7. Portal shell (customer / reseller / admin) ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 2rem; padding: 2rem 0 3rem; flex: 1; align-items: start; }
.sidebar-menu, .admin-sidebar, .sidebar, .side-nav { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: calc(var(--header-h) + 1.5rem); max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; scrollbar-width: thin; }
.side-group { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 1rem .9rem .35rem; }
.side-group:first-child { padding-top: 0; }
.menu-link, .admin-side-link, .side-item, .side-link {
  padding: .72rem .95rem; border-radius: 12px; font-size: .875rem; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: .75rem; position: relative;
}
.menu-link:hover, .admin-side-link:hover, .side-item:hover, .side-link:hover { background: var(--surface-2); color: var(--ink); }
.menu-link.active, .admin-side-link.active, .side-item.active, .side-link.active { background: var(--brand-soft); color: var(--link); box-shadow: inset 0 0 0 1px var(--brand-line); }
.menu-link.active::before, .admin-side-link.active::before, .side-item.active::before, .side-link.active::before { content: ""; position: absolute; inset-inline-start: -2px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--brand-grad); }
.side-link .count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: .05rem .45rem; font-weight: 700; }
.shell-main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-strong); }
.page-sub { color: var(--ink-3); font-size: .9rem; margin-top: .15rem; }
.user-chip { display: inline-flex; align-items: center; gap: .6rem; padding: .3rem .8rem .3rem .3rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; }

/* ---------- 8. Storefront ---------- */
main { flex: 1; }
.hero-section { position: relative; padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem 1rem; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 999px; color: var(--link); font-size: .76rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: .04em; text-transform: uppercase; }
.hero-title { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; line-height: 1.08; letter-spacing: -.035em; margin-bottom: 1.25rem; color: var(--ink-strong); }
html[lang="bn"] .hero-title, html[lang="hi"] .hero-title { line-height: 1.25; letter-spacing: 0; }
.hero-subtitle { color: var(--ink-2); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 640px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.trust-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 760px; margin: 3rem auto 0; }
.stat-item { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.1rem; backdrop-filter: blur(10px); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--ink-strong); letter-spacing: -.02em; }
.stat-label { font-size: .78rem; color: var(--ink-3); }
.banner-slider { position: relative; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line); margin-top: 1.5rem; box-shadow: var(--shadow-md); }
.banner-track { display: flex; transition: transform .6s var(--ease); }
.banner-slide { min-width: 100%; position: relative; aspect-ratio: 21/8; background: var(--surface-2); display: flex; align-items: flex-end; }
.banner-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(3,7,16,.85)); }
.banner-copy { position: relative; z-index: 1; padding: clamp(1rem, 3vw, 2.2rem); color: #fff; }
.banner-copy h3 { font-size: clamp(1.1rem, 3vw, 2rem); font-weight: 800; }
.banner-copy p { opacity: .85; font-size: .95rem; }
.banner-dots { position: absolute; bottom: 12px; inset-inline-end: 16px; display: flex; gap: 6px; z-index: 2; }
.banner-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: rgba(255,255,255,.45); transition: .3s; padding: 0; }
.banner-dots button.on { width: 24px; background: #fff; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 3.5rem 0 1.5rem; }
.section-title { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink-strong); }
.section-eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; display: block; margin-bottom: .3rem; }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1rem; }
.category-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem 1rem; text-align: center; position: relative; overflow: hidden; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.category-card::before { content: ""; position: absolute; inset: 0; background: var(--brand-grad); opacity: 0; transition: opacity .3s; }
.category-card:hover { transform: translateY(-4px); border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.category-card:hover::before { opacity: .06; }
.category-icon { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto .85rem; background: var(--brand-soft); color: var(--link); display: flex; align-items: center; justify-content: center; position: relative; }
.category-icon .icon { width: 26px; height: 26px; }
.category-name { font-weight: 700; font-size: .95rem; position: relative; }
.category-count { color: var(--ink-3); font-size: .76rem; position: relative; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.product-card:hover { transform: translateY(-5px); border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.product-image-container { width: 100%; aspect-ratio: 16/11; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: var(--ink-3); }
.product-image-container .icon { width: 44px; height: 44px; opacity: .55; }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.product-card:hover .product-image { transform: scale(1.06); }
.product-badge { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); color: var(--ink); font-size: .68rem; font-weight: 800; padding: .22rem .65rem; border-radius: 999px; letter-spacing: .06em; }
.product-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; justify-content: space-between; }
.product-category { font-size: .7rem; color: var(--gold); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .25rem; }
.product-title { font-size: 1.02rem; font-weight: 750; line-height: 1.35; color: var(--ink-strong); }
.product-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; }
.price-from { font-size: .7rem; color: var(--ink-3); display: block; }
.price-value { font-size: 1.2rem; font-weight: 800; color: var(--ink-strong); letter-spacing: -.01em; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; }
.feature .kpi-icon { margin-bottom: 1rem; width: 44px; height: 44px; border-radius: 13px; }
.feature h3 { font-size: 1rem; font-weight: 750; margin-bottom: .35rem; color: var(--ink-strong); }
.feature p { font-size: .88rem; color: var(--ink-2); }
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; counter-reset: s; }
.steps-row .feature { position: relative; counter-increment: s; }
.steps-row .feature::before { content: counter(s); position: absolute; top: 1rem; inset-inline-end: 1.2rem; font-size: 2.6rem; font-weight: 800; color: var(--surface-3); line-height: 1; }
.cta-band { margin: 4rem 0 5rem; border-radius: var(--radius-xl); padding: clamp(2rem, 5vw, 3.5rem); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; text-align: center; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: var(--aurora); opacity: .9; }
.cta-band > * { position: relative; }
.cat-header { padding: 3rem 0 1rem; }
.cat-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; color: var(--ink-strong); }
.cat-subtitle { color: var(--ink-2); }
.page-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow-sm); }
.prose h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; margin-bottom: 1.5rem; letter-spacing: -.02em; color: var(--ink-strong); }
.prose h2 { font-size: 1.2rem; font-weight: 750; margin: 1.8rem 0 .6rem; color: var(--ink-strong); }
.prose p, .prose li { color: var(--ink-2); font-size: .95rem; margin-bottom: .8rem; }
.prose ul { list-style: disc; padding-inline-start: 1.3rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); margin-bottom: .75rem; overflow: hidden; }
.faq-item summary { padding: 1.05rem 1.25rem; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 1rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { transition: transform .3s var(--ease); color: var(--ink-3); }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item[open] { border-color: var(--brand-line); }
.faq-item .faq-a { padding: 0 1.25rem 1.2rem; color: var(--ink-2); font-size: .92rem; }

/* Product detail / checkout */
.product-view-container { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; padding: 2.5rem 0 3rem; align-items: start; }
.product-info-panel { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.product-preview-img { width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-xl); overflow: hidden; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; margin-bottom: 1.4rem; color: var(--ink-3); box-shadow: var(--shadow-md); }
.product-preview-img .icon { width: 64px; height: 64px; opacity: .5; }
.product-preview-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-title { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: .8rem; color: var(--ink-strong); }
.product-badge-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.configurator-panel { display: flex; flex-direction: column; gap: 1.1rem; }
.step-box, .checkout-summary-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 1.5rem; }
.checkout-summary-box { border-color: var(--brand-line); box-shadow: var(--shadow-glow); }
.step-header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.2rem; }
.step-number { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 800; flex-shrink: 0; }
.step-title { font-size: 1.05rem; font-weight: 750; }
.variants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.variant-option { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-md); padding: .9rem 1rem; cursor: pointer; transition: .2s var(--ease); position: relative; user-select: none; }
.variant-option:hover { border-color: var(--brand-line); transform: translateY(-2px); }
.variant-option.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.variant-option.selected::after { content: ""; position: absolute; top: 10px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.variant-label { font-size: .86rem; font-weight: 650; margin-bottom: .2rem; }
.variant-price { font-size: 1rem; font-weight: 800; color: var(--link); }
.summary-line { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; font-size: .88rem; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding: 1rem 0 1.2rem; font-weight: 700; }
.summary-total span:last-child { font-size: 1.7rem; font-weight: 800; color: var(--ink-strong); letter-spacing: -.02em; }
.player-check { display: flex; gap: .6rem; }
.player-check .form-control { flex: 1; }
.player-result { margin-top: .6rem; font-size: .84rem; display: none; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: 10px; }
.player-result.ok { display: flex; background: var(--success-soft); color: var(--success); }
.player-result.bad { display: flex; background: var(--danger-soft); color: var(--danger); }
.assure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-top: 1rem; }
.assure { display: flex; gap: .6rem; align-items: center; font-size: .78rem; color: var(--ink-2); padding: .65rem .8rem; background: var(--surface-2); border-radius: 12px; }
.assure .icon { color: var(--success); }

/* Auth */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 2.5rem 1.25rem; }
.auth-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: clamp(1.6rem, 4vw, 2.5rem); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--brand-grad); }
.auth-head { text-align: center; margin-bottom: 1.8rem; }
.auth-head .brand-mark { margin: 0 auto 1rem; width: 52px; height: 52px; border-radius: 16px; }
.auth-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-strong); }
.auth-head p { color: var(--ink-2); font-size: .88rem; margin-top: .3rem; }
.auth-foot { text-align: center; margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-3); }
.auth-foot a { color: var(--link); font-weight: 700; }

/* ---------- 9. Footer ---------- */
.footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--line); padding: 3.5rem 0 2rem; font-size: .875rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-heading { color: var(--ink-strong); font-size: .78rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: .1em; text-transform: uppercase; }
.footer-links li { margin-bottom: .6rem; }
.footer-links a:hover { color: var(--link); }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--ink-3); font-size: .8rem; }
.pay-chips { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- 10. Toasts / skeleton / reveal ---------- */
.toast-stack { position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 300; display: flex; flex-direction: column; gap: .6rem; max-width: calc(100vw - 2rem); }
.toast { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: .8rem 1.1rem; box-shadow: var(--shadow-lg); font-size: .86rem; display: flex; gap: .6rem; align-items: center; animation: toast-in .4s var(--ease); }
.toast.success .icon { color: var(--success); } .toast.error .icon { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .reveal { opacity: 1; transform: none; } }

/* ---------- 11. Responsive ---------- */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding-top: 1.25rem; }
  .shell > aside { display: none; }
  .burger { display: inline-flex; }
  .nav-links, .search-form.desktop-only, .hide-md { display: none !important; }
  .product-view-container { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .product-info-panel { position: static; }
  .trust-stats { gap: .6rem; }
  .stat-item { padding: .8rem .5rem; } .stat-value { font-size: 1.15rem; }
  .banner-slide { aspect-ratio: 16/9; }
}
@media (max-width: 720px) {
  :root { --header-h: 60px; }
  body { padding-bottom: 72px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 95; background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .4rem 0; font-size: .66rem; font-weight: 650; color: var(--ink-3); border-radius: 12px; }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--link); }
  .bottom-nav a.active .icon { filter: drop-shadow(0 0 8px var(--brand)); }
  .toast-stack { bottom: 84px; }
  .container, .container-fluid { padding-inline: 1rem; }
  .section-header { margin-top: 2.5rem; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .product-body { padding: .85rem; gap: .7rem; } .product-title { font-size: .9rem; } .price-value { font-size: 1.02rem; }
  .product-footer .btn { display: none; }
  .categories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .step-box, .checkout-summary-box { padding: 1.15rem; border-radius: var(--radius-lg); }
  .variants-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title { font-size: 1.35rem; }
  .card, .content-card, .admin-card { padding: 1.1rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; } .kpi-value { font-size: 1.3rem; } .kpi { padding: 1rem; }
  .hide-sm { display: none !important; }
  .nav-actions .btn-outline.hide-sm { display: none; }
  .player-check { flex-direction: column; }
  th, td { padding: .7rem .65rem; }
  .menu { position: fixed; inset-inline: .75rem; top: calc(var(--header-h) + 6px); min-width: 0; }
}
@media (max-width: 380px) { .products-grid, .categories-grid { grid-template-columns: 1fr; } }
/* form grids used by many portal pages collapse gracefully */
@media (max-width: 720px) {
  [style*="grid-template-columns: 1fr 1fr"], [style*="grid-template-columns: repeat(2"], [style*="grid-template-columns: 2fr 1fr"], [style*="grid-template-columns: 1fr 2fr"], [style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media print { .navbar, .footer, .bottom-nav, .shell > aside, .toast-stack { display: none !important; } body { background: #fff; color: #000; } }


/* ==========================================================================
   v3: professional header, announcement bar, footer, brand logo, theme icons
   ========================================================================== */
.brand-img { width: auto; max-width: 190px; object-fit: contain; display: block; }
.brand-img-light { display: none; }
html[data-theme="light"] .brand-img-dark { display: none; }
html[data-theme="light"] .brand-img-light { display: block; }
.theme-ico { display: none; }
html[data-theme="light"] .ico-light { display: inline-block; }
html[data-theme="dark"] .ico-dark { display: inline-block; }
.icon-btn-wide { width: auto; padding: 0 .8rem; gap: .45rem; display: inline-flex; align-items: center; }
.nav-left { display: flex; align-items: center; gap: .75rem; }
.nav-links .dropdown > .nav-link { background: none; border: 0; cursor: pointer; }
.nav-links .dropdown > .nav-link .icon { width: 14px; height: 14px; opacity: .7; transition: transform .25s var(--ease); }
.nav-links .dropdown.open > .nav-link .icon { transform: rotate(180deg); }
.nav-link { position: relative; }
.nav-link.active::after { content: ""; position: absolute; inset-inline: .85rem; bottom: -2px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.nav-link.active { background: transparent; color: var(--ink-strong); }
.site-header { transition: box-shadow .3s var(--ease), background-color .3s, border-color .3s; }
.site-header.is-scrolled { box-shadow: 0 8px 30px -14px rgba(0,0,0,.5); border-bottom-color: var(--line-strong); }
html[data-theme="light"] .site-header.is-scrolled { box-shadow: 0 8px 26px -16px rgba(15,23,42,.28); }
body[data-header="solid"] .site-header { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu-wide { min-width: 400px; inset-inline-start: 0; inset-inline-end: auto; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; }
.menu-user { padding: .6rem .8rem; display: flex; flex-direction: column; font-size: .82rem; color: var(--ink-3); }
.menu-user strong { color: var(--ink-strong); font-size: .92rem; }
.dropdown[data-hover]:hover .menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: none) { .dropdown[data-hover]:hover:not(.open) .menu { opacity: 0; visibility: hidden; } }
.topbar { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--ink-3); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 36px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.topbar a, .topbar span { display: inline-flex; align-items: center; gap: .4rem; }
.topbar a:hover { color: var(--link); }
.topbar .icon { width: 14px; height: 14px; }
.announce { background: var(--brand-grad); color: #fff; font-size: .85rem; font-weight: 600; }
.announce-inner { display: flex; align-items: center; justify-content: center; gap: .6rem; padding-block: .55rem; text-align: center; position: relative; padding-inline-end: 2.5rem; }
.announce-close { position: absolute; inset-inline-end: 1rem; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.18); border: 0; border-radius: 8px; color: #fff; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.announce-close:hover { background: rgba(255,255,255,.3); }
.footer-contact li { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .7rem; color: var(--ink-2); }
.footer-contact .icon { margin-top: .25rem; color: var(--brand); }
.footer-contact a:hover { color: var(--link); }
.footer-note { color: var(--ink-3); font-size: .78rem; margin-bottom: 1.2rem; max-width: 900px; }
.social-row { display: flex; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.social-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.social-btn:hover { background: var(--brand-grad); color: #fff; border-color: transparent; transform: translateY(-2px); }
.footer-grid > div { min-width: 0; }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr !important; } .menu-wide { min-width: 0; } .menu-grid { grid-template-columns: 1fr; } }

/* ---- Admin branding page ---- */
.set-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; position: sticky; top: calc(var(--header-h) + .5rem); z-index: 20; background: var(--glass); backdrop-filter: blur(14px); padding: .5rem; border: 1px solid var(--line); border-radius: 16px; }
.set-tabs a { padding: .5rem .9rem; border-radius: 10px; font-size: .82rem; font-weight: 650; color: var(--ink-2); display: inline-flex; gap: .45rem; align-items: center; }
.set-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.set-section { scroll-margin-top: calc(var(--header-h) + 5rem); margin-bottom: 1.25rem; }
.set-section h2 { font-size: 1.05rem; font-weight: 750; margin-bottom: .25rem; display: flex; align-items: center; gap: .6rem; }
.set-section .sub { color: var(--ink-3); font-size: .84rem; margin-bottom: 1.25rem; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.set-grid .full { grid-column: 1 / -1; }
.color-field { display: flex; gap: .6rem; align-items: center; }
.color-field input[type="color"] { width: 46px; height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); padding: 3px; cursor: pointer; }
.upload-box { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); padding: 1rem; display: flex; gap: 1rem; align-items: center; background: var(--surface-2); }
.upload-box .thumb { width: 72px; height: 72px; border-radius: 12px; background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 50%/16px 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1px solid var(--line); }
.upload-box .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.switch-row label { font-size: .88rem; font-weight: 600; cursor: pointer; flex: 1; }
.save-bar { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; z-index: 30; }
.save-bar .inner { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 999px; padding: .5rem; box-shadow: var(--shadow-lg); display: flex; gap: .5rem; }
@media (max-width: 720px) { .set-grid { grid-template-columns: 1fr; } .save-bar { bottom: 78px; } .upload-box { flex-direction: column; align-items: flex-start; } }

/* v3.1 header fit fixes */
.search-form { flex: 1 1 200px; min-width: 150px; }
.nav-links { flex-shrink: 0; }
.nav-actions { flex-shrink: 0; }
.nav-content { gap: .75rem; }
@media (max-width: 1180px) { .nav-link { padding: .5rem .6rem; font-size: .84rem; } .topbar-left a:nth-child(3), .topbar-left span { display: none; } }
@media (max-width: 720px) {
  .nav-content .brand-sub, .lang-current { display: none; }
  .icon-btn-wide { width: 40px; padding: 0; justify-content: center; }
  .nav-actions { gap: .4rem; }
  .brand-logo, .brand { font-size: 1.1rem; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .user-chip { padding: .2rem; }
  .mobile-search { padding-inline: 1rem; }
}

/* v4: listing filters, stock states, activity feed */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1.25rem 0 0; padding: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.filter-bar .form-control { width: auto; min-width: 150px; padding: .55rem .9rem; font-size: .85rem; border-radius: 999px; }
.filter-bar .filter-search { flex: 1 1 220px; }
.filter-bar .filter-search .form-control { width: 100%; padding-inline-start: 2.6rem; }
.filter-chip { cursor: pointer; user-select: none; }
.badge-soldout { top: 12px; inset-inline-start: auto; inset-inline-end: 12px; background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.variant-option.is-disabled { opacity: .45; cursor: not-allowed; }
.variant-option.is-disabled:hover { transform: none; border-color: var(--line); }
.variant-stock { font-size: .7rem; color: var(--danger); font-weight: 700; margin-top: .15rem; }
.activity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.activity-item { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.activity-item .kpi-icon { background: var(--success-soft); color: var(--success); flex-shrink: 0; }
.activity-item div { display: flex; flex-direction: column; min-width: 0; font-size: .88rem; }
.activity-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .filter-bar .form-control { flex: 1 1 140px; min-width: 0; } }
/* help center + content */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--brand-line); box-shadow: var(--shadow-md); }
.post-cover { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); display: flex; align-items: center; justify-content: center; color: var(--ink-3); overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover .icon { width: 38px; height: 38px; opacity: .5; }
.post-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.post-meta { font-size: .74rem; color: var(--ink-3); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.post-title { font-size: 1.05rem; font-weight: 750; color: var(--ink-strong); line-height: 1.35; }
.post-excerpt { color: var(--ink-2); font-size: .88rem; }
.tabs-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.2rem 0; }
.tabs-row a { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line); font-size: .84rem; font-weight: 650; color: var(--ink-2); background: var(--surface); }
.tabs-row a.active, .tabs-row a:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--link); }
.article { max-width: 780px; margin-inline: auto; }
.article-cover { border-radius: var(--radius-xl); overflow: hidden; margin: 1.5rem 0; border: 1px solid var(--line); }
.article-cover img { width: 100%; }
.prose img { border-radius: var(--radius-md); margin: 1rem 0; }
.prose a { color: var(--link); text-decoration: underline; }
.prose h3 { font-size: 1.05rem; font-weight: 700; margin: 1.2rem 0 .4rem; color: var(--ink-strong); }
.prose blockquote { border-inline-start: 3px solid var(--brand); padding: .4rem 1rem; color: var(--ink-2); background: var(--surface-2); border-radius: 0 10px 10px 0; margin: 1rem 0; }
.prose code { font-family: var(--font-mono); background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .85em; }
.prose ol { padding-inline-start: 1.3rem; }

/* v6: category images, plans */
.category-thumb { width: 100%; aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; margin: -.2rem 0 .85rem; position: relative; background: var(--surface-2); }
.category-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.category-card:hover .category-thumb img { transform: scale(1.07); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; position: relative; }
.plan.is-current { border-color: var(--brand); box-shadow: var(--shadow-glow); }
.plan-name { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; }
.plan-price { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink-strong); }
.plan-price small { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.plan ul li { display: flex; gap: .5rem; font-size: .86rem; color: var(--ink-2); margin-bottom: .35rem; }
.plan ul .icon { color: var(--success); margin-top: .2rem; }
