/* Botawan — premium product UI */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");

:root {
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-width: 268px;
    --font: "Plus Jakarta Sans", "DM Sans", "Trebuchet MS", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 0.2s;
    --theme-color: #0a1020;
}

/* Dark theme (default product look) */
html:not([data-theme]),
html[data-theme="dark"] {
    --bg: #070b14;
    --bg-deep: #04070f;
    --surface: rgba(14, 20, 34, 0.88);
    --surface-solid: #101826;
    --surface-elevated: rgba(18, 26, 42, 0.96);
    --surface-muted: rgba(15, 23, 42, 0.55);
    --text: #f2f5fb;
    --muted: #8b98b3;
    --border: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.22);
    --primary: #3b82f6;
    --primary-hover: #6aa4ff;
    --primary-soft: rgba(59, 130, 246, 0.14);
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.12);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 22px 50px rgba(0, 0, 0, 0.4);
    --topbar-bg: rgba(7, 11, 20, 0.72);
    --table-hover: rgba(59, 130, 246, 0.07);
    --code-bg: rgba(59, 130, 246, 0.16);
    --code-color: #93c5fd;
    --badge-muted-bg: rgba(148, 163, 184, 0.12);
    --sidebar-bg: #050910;
    --sidebar-hover: #1e293b;
    --sidebar-text: #f2f5fb;
    --sidebar-muted: #8491ab;
    --input-bg: rgba(6, 10, 18, 0.9);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.28);
    --theme-color: #0a1020;
    --chart-line: #2dd4bf;
    --chart-line-soft: #99f6e4;
    --chart-fill: rgba(45, 212, 191, 0.35);
    color-scheme: dark;
}

/* Light theme — Real Estate inspired */
html[data-theme="light"] {
    --bg: #f8fafc;
    --bg-deep: #f1f5f9;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-elevated: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.1);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 28px rgba(15, 23, 42, 0.1);
    --topbar-bg: rgba(255, 255, 255, 0.92);
    --table-hover: rgba(37, 99, 235, 0.06);
    --code-bg: #eff6ff;
    --code-color: #1d4ed8;
    --badge-muted-bg: #f1f5f9;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f5f9;
    --sidebar-text: #0f172a;
    --sidebar-muted: #64748b;
    --input-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
    --theme-color: #f1f5f9;
    --chart-line: #2563eb;
    --chart-line-soft: #60a5fa;
    --chart-fill: rgba(37, 99, 235, 0.28);
    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    background-color: var(--bg-deep);
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
    color: var(--text);
}

:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.55);
    outline-offset: 2px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg-deep);
    background-attachment: fixed;
    line-height: 1.55;
    font-size: 15px;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[data-theme="light"] body {
    background-color: #f4f7fb;
    background-image:
        radial-gradient(980px 520px at 8% -8%, rgba(37, 99, 235, 0.1), transparent 58%),
        radial-gradient(860px 480px at 100% 0%, rgba(14, 165, 233, 0.08), transparent 52%),
        linear-gradient(180deg, #eef2ff 0%, #f8fafc 42%, #f1f5f9 100%);
}

html:not([data-theme]) body,
html[data-theme="dark"] body {
    background-image:
        radial-gradient(900px 520px at 8% -10%, rgba(56, 189, 248, 0.16), transparent 55%),
        radial-gradient(820px 480px at 100% 0%, rgba(37, 99, 235, 0.18), transparent 50%),
        linear-gradient(180deg, #08101c 0%, var(--bg-deep) 48%, #04070f 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Soft modern dot field */
html[data-theme="light"] body::before {
    opacity: 0.5;
    background-image:
        radial-gradient(ellipse 80% 55% at 50% -10%, rgba(37, 99, 235, 0.08), transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(100, 116, 139, 0.22) 1px, transparent 0);
    background-size: auto, 32px 32px;
    mask-image: radial-gradient(ellipse 95% 75% at 50% 18%, #000 12%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 18%, #000 12%, transparent 78%);
}

html:not([data-theme]) body::before,
html[data-theme="dark"] body::before {
    opacity: 0.4;
    background-image:
        radial-gradient(ellipse 80% 55% at 50% -10%, rgba(56, 189, 248, 0.07), transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.2) 1px, transparent 0);
    background-size: auto, 32px 32px;
    mask-image: radial-gradient(ellipse 95% 75% at 50% 18%, #000 12%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 18%, #000 12%, transparent 78%);
}

.app-shell,
.auth-wrap,
.landing-body {
    position: relative;
    z-index: 1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}

a:hover { color: var(--primary-hover); }

h1, h2, h3 {
    margin: 0 0 0.35rem;
    line-height: 1.2;
    letter-spacing: -0.04em;
    font-weight: 700;
}

h1 { font-size: clamp(1.55rem, 2vw, 1.85rem); }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.025em; }

.muted, .help-text, .auth-sub { color: var(--muted); }

/* Thin elegant scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-track { background: transparent; }

.help-text {
    margin: 0.35rem 0 0;
    font-size: 0.84rem;
}

/* -------- Auth -------- */
.auth-body { min-height: 100vh; }

.auth-wrap {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3.5rem);
    color: #f8fafc;
    background:
        radial-gradient(640px 420px at 18% 88%, rgba(59, 130, 246, 0.32), transparent 58%),
        radial-gradient(520px 340px at 92% 8%, rgba(14, 165, 233, 0.16), transparent 52%),
        linear-gradient(165deg, #04070f 0%, #0a1426 55%, #07101c 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    animation: authRise 0.7s var(--ease-out) both;
}

.auth-showcase-glow {
    position: absolute;
    inset: auto -10% 10% auto;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 68%);
    pointer-events: none;
    filter: blur(8px);
}

.auth-showcase-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: auto;
    color: #fff;
    position: relative;
    z-index: 1;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem !important;
    padding: 0.35rem 0.7rem;
    width: fit-content;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #93c5fd !important;
    font-size: 0.78rem !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-showcase h2 {
    font-size: clamp(2rem, 3.4vw, 2.85rem);
    font-weight: 800;
    max-width: 12ch;
    color: #fff;
    margin-bottom: 0.85rem;
    letter-spacing: -0.05em;
    line-height: 1.08;
    position: relative;
    z-index: 1;
}

.auth-showcase p,
.auth-lead {
    max-width: 36ch;
    color: rgba(248, 250, 252, 0.68);
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.55;
    position: relative;
    z-index: 1;
}

.auth-points {
    list-style: none;
    margin: 1.35rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    position: relative;
    z-index: 1;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(226, 232, 240, 0.88);
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-points .ico {
    color: #6ee7b7;
    width: 15px;
    height: 15px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    margin: auto;
    padding: 2.1rem 1.6rem;
    animation: authRise 0.7s var(--ease-out) 0.08s both;
}

.auth-card .btn-primary {
    min-height: 2.75rem;
    border-radius: 12px;
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-brand { display: none; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 1.15rem;
    color: var(--muted);
    font-weight: 650;
    font-size: 0.9rem;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--primary);
}

.auth-showcase-brand {
    color: #fff;
    text-decoration: none;
}

.auth-showcase-brand:hover {
    color: #fff;
}

.auth-heading { margin-bottom: 0.25rem; }

.auth-sub { margin: 0 0 1.35rem; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.05rem 0 1.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.18);
}

.btn-facebook {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: #1877f2;
    border: 1px solid #1877f2;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(24, 119, 242, 0.28);
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #fff;
    text-decoration: none;
}

.btn-facebook .ico {
    width: 16px;
    height: 16px;
}

.auth-footer-text {
    margin: 1.35rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

/* -------- App shell -------- */
.app-shell {
    display: flex;
    align-items: flex-start;
    min-height: 100dvh;
    width: 100%;
}

.app-body {
    min-height: 100dvh;
    overflow-x: clip;
}

.sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent 28%),
        var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 0.9rem;
    position: sticky;
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    align-self: flex-start;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0.2rem 0.55rem;
}

.sidebar-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 1.05rem;
    letter-spacing: -0.03em;
}

.brand-text small {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--sidebar-muted);
    letter-spacing: 0.01em;
    margin-top: 0.12rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
    font-size: 0.72rem;
    font-weight: 750;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 0;
    display: block;
    flex-shrink: 0;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}

.locale-ku,
.locale-ar,
html[dir="rtl"] body.app-body,
html[dir="rtl"] body.auth-body {
    font-family: "Speda", "Noto Sans Arabic", var(--font), Tahoma, sans-serif;
}

.locale-ku .nav-link,
.locale-ar .nav-link,
.locale-ku .btn,
.locale-ar .btn,
.locale-ku h1,
.locale-ar h1,
.locale-ku h2,
.locale-ar h2,
.locale-ku .upgrade-title,
.locale-ar .upgrade-title {
    font-family: "Speda", "Noto Sans Arabic", var(--font), Tahoma, sans-serif;
}

.lang-switch-dropdown {
    position: relative;
    display: inline-flex;
    z-index: 40;
}

.lang-switch-top { margin-inline-end: 0.35rem; }

.lang-switch-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.2rem;
    padding: 0.28rem 0.55rem 0.28rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.lang-switch-trigger:hover {
    border-color: var(--border-strong);
    background: var(--surface-muted);
}

.lang-switch-dropdown.is-open .lang-switch-trigger {
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.lang-switch-ico {
    display: grid;
    place-items: center;
    color: var(--primary);
}

.lang-flag {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
}

.lang-switch-trigger .lang-code {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
    color: var(--text);
}

.lang-switch-trigger .lang-name {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--muted);
}

.lang-chevron {
    display: grid;
    place-items: center;
    color: var(--muted);
    margin-inline-start: 0.05rem;
    transition: transform 0.18s ease, color 0.18s ease;
}

.lang-switch-dropdown.is-open .lang-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.lang-switch-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-end: 0;
    min-width: 13.5rem;
    padding: 0.45rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: langMenuIn 0.18s ease both;
}

@keyframes langMenuIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-switch-menu[hidden] { display: none !important; }

.lang-switch-menu-label {
    margin: 0;
    padding: 0.35rem 0.7rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.72);
}

.lang-switch-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.7rem;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lang-switch-option .lang-flag {
    width: 1.55rem;
    height: 1.55rem;
}

.lang-option-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}

.lang-switch-option .lang-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
}

.lang-switch-option .lang-code {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
}

.lang-option-check {
    display: grid;
    place-items: center;
    color: var(--primary);
    flex-shrink: 0;
}

.lang-option-check .ico {
    width: 14px;
    height: 14px;
}

.lang-switch-option:hover {
    background: var(--surface-muted);
    border-color: var(--border);
    color: var(--text);
    text-decoration: none;
}

.lang-switch-option.is-active {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    color: var(--text);
}

.lang-switch-option.is-active .lang-code {
    color: var(--primary);
}

.lang-switch-top .lang-name { display: none; }

.price-badge {
    display: inline-flex;
    margin-bottom: 0.7rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.price-badge-soft {
    background: var(--badge-muted-bg);
    color: var(--muted);
}

html[dir="rtl"] .sidebar-nav .nav-link,
html[dir="rtl"] .top-user,
html[dir="rtl"] .panel-head {
    text-align: right;
}

.brand-logo-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.brand-logo-lg {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.auth-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.nav-group + .nav-group {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-group-label {
    display: block;
    padding: 0 0.85rem 0.45rem;
    color: rgba(148, 163, 184, 0.55);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--sidebar-muted);
    text-decoration: none;
    padding: 0.68rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.015em;
    transition:
        background 0.2s var(--ease),
        color 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        transform 0.2s var(--ease-out);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.65);
    outline-offset: 2px;
}

.nav-link.active {
    background: linear-gradient(135deg, #4f8ff7 0%, #2563eb 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 10px 22px rgba(37, 99, 235, 0.32);
}

.nav-link .ico { opacity: 0.72; width: 17px; height: 17px; }
.nav-link.active .ico { opacity: 1; }

.nav-divider {
    height: 1px;
    margin: 0.55rem 0.55rem;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link {
    font-size: 0.88rem;
    padding: 0.62rem 0.85rem;
}

.ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.9;
}

.ico-sm {
    width: 14px;
    height: 14px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 0.55rem;
}

.user-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem;
}

.user-chip-name {
    display: block;
    font-weight: 650;
    color: #fff;
    font-size: 0.92rem;
}

.user-chip-email {
    display: block;
    font-size: 0.78rem;
    color: var(--sidebar-muted);
    word-break: break-all;
    margin-top: 0.15rem;
}

.main-wrap {
    flex: 1;
    min-width: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.35rem;
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.topbar-title {
    font-weight: 650;
    letter-spacing: -0.02em;
    flex: 1;
    font-size: 0.95rem;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    place-items: center;
    padding: 0;
    box-shadow: var(--shadow);
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    display: block;
    width: 16px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    transition: transform 0.2s var(--ease);
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-toggle-bars::before { top: -5px; }
.menu-toggle-bars::after { top: 5px; }

.main-content {
    flex: 1 0 auto;
    padding: 1.1rem 1.25rem 1.25rem;
    width: 100%;
    max-width: none;
    animation: contentRise 0.45s var(--ease-out) both;
}

@keyframes contentRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content-wide {
    max-width: none;
}

.sidebar-backdrop {
    display: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: var(--surface-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.upgrade-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    background:
        radial-gradient(120px 70px at 100% 0%, rgba(248, 113, 113, 0.12), transparent 70%),
        var(--surface);
    border: 1px solid rgba(248, 113, 113, 0.18);
    border-radius: 16px;
    padding: 0.8rem 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.upgrade-card:hover {
    color: inherit;
    text-decoration: none;
    border-color: rgba(248, 113, 113, 0.34);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 22px rgba(2, 6, 23, 0.22);
}

.upgrade-card.is-business {
    border-color: rgba(45, 212, 191, 0.2);
    background:
        radial-gradient(120px 70px at 100% 0%, rgba(45, 212, 191, 0.12), transparent 70%),
        var(--surface);
}

.upgrade-card.is-business .upgrade-plan-row {
    color: #5eead4;
}

.upgrade-card.is-business .upgrade-plan-row:last-child {
    color: #99f6e4;
    font-weight: 600;
    font-size: 0.75rem;
}

html[data-theme="light"] .upgrade-card {
    background:
        radial-gradient(130px 80px at 100% 0%, rgba(244, 63, 94, 0.08), transparent 72%),
        #fff;
    border-color: rgba(244, 63, 94, 0.16);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .upgrade-card:hover {
    border-color: rgba(244, 63, 94, 0.28);
    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .upgrade-plan-row {
    color: #e11d48;
}

html[data-theme="light"] .upgrade-cta {
    border-color: rgba(225, 29, 72, 0.2);
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.16), rgba(244, 63, 94, 0.08));
    color: #9f1239;
}

html[data-theme="light"] .upgrade-card.is-business {
    border-color: rgba(5, 150, 105, 0.22);
    background:
        linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.04) 55%, #fff 100%),
        #fff;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .upgrade-card.is-business:hover {
    border-color: rgba(5, 150, 105, 0.34);
    background:
        linear-gradient(145deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.06) 55%, #fff 100%),
        #fff;
    box-shadow:
        0 8px 20px rgba(5, 150, 105, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .upgrade-card.is-business .upgrade-plan-row {
    color: #047857;
}

html[data-theme="light"] .upgrade-card.is-business .upgrade-plan-row:last-child {
    color: #059669;
}

html[data-theme="light"] .upgrade-card.is-business .upgrade-plan-ico {
    color: #059669;
    opacity: 1;
}

.upgrade-plan-meta {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.upgrade-plan-row {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #fb7185;
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.upgrade-plan-countdown {
    font-weight: 700;
}

.upgrade-plan-ico {
    width: 1.15rem;
    height: 1.15rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    opacity: 0.92;
}

.upgrade-plan-ico .ico {
    width: 15px;
    height: 15px;
}

.upgrade-plan-timer {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.upgrade-cta {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.22), rgba(244, 63, 94, 0.12));
    color: #ffe4e6;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.upgrade-cta-arrow {
    opacity: 0.85;
    transition: transform 0.18s ease;
}

.upgrade-card:hover .upgrade-cta-arrow {
    transform: translateX(2px);
}

.upgrade-copy {
    display: none;
}

.upgrade-title {
    font-weight: 750;
    color: #fff;
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: -0.02em;
}

.upgrade-card small {
    color: #93c5fd;
    font-size: 0.68rem;
    font-weight: 650;
}

.upgrade-card-compact p,
.upgrade-card-compact .btn-sm {
    display: none;
}

.admin-badge-card {
    display: block;
    padding: 0.65rem 0.75rem;
}

.admin-badge-card .upgrade-title {
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}

.admin-badge-card p {
    display: block;
    margin: 0;
    color: var(--sidebar-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    word-break: break-all;
}

.top-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.58rem 1rem;
    max-width: 480px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.top-search:focus-within {
    border-color: rgba(96, 165, 250, 0.45);
    background: var(--surface-muted);
    box-shadow: var(--focus-ring);
}

.top-search-svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.top-search input {
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    width: 100%;
    outline: none;
}

.top-search input::placeholder { color: var(--muted); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    position: relative;
    text-decoration: none;
    transition:
        color var(--dur) var(--ease),
        border-color var(--dur) var(--ease),
        background var(--dur) var(--ease),
        transform var(--dur) var(--ease-out);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.top-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.55rem 0.25rem 0.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.top-user:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 750;
    font-size: 0.78rem;
    letter-spacing: -0.02em;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.avatar-photo {
    object-fit: cover;
    padding: 0;
    background: var(--surface-muted);
    display: block;
}

.top-user-meta {
    display: none;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.top-user-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

.top-user-role {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 550;
}

@media (min-width: 700px) {
    .top-user-meta { display: flex; }
}

a.icon-btn:hover,
.icon-btn:hover {
    color: var(--text);
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.dash-welcome,
.dash-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background:
        radial-gradient(640px 220px at 100% -10%, rgba(56, 189, 248, 0.18), transparent 55%),
        radial-gradient(420px 180px at 0% 100%, rgba(37, 99, 235, 0.16), transparent 60%),
        var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: contentRise 0.55s var(--ease-out) both;
}

.dash-hero::after {
    content: "";
    position: absolute;
    inset: auto -20% -60% auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 68%);
    pointer-events: none;
}

.dash-hero.is-live {
    border-color: rgba(52, 211, 153, 0.22);
}

.dash-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.55rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-hero.is-live .dash-eyebrow { color: var(--success); }

.dash-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.18);
    animation: pulseDot 1.8s ease-in-out infinite;
}

.dash-hero.is-live .dash-status-dot {
    box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.18);
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.65; }
}

.dash-welcome h1,
.dash-hero h1 {
    font-size: clamp(1.55rem, 2.4vw, 1.95rem);
    margin: 0 0 0.35rem;
    letter-spacing: -0.045em;
}

.dash-welcome .muted,
.dash-hero .muted {
    margin: 0;
    max-width: 52ch;
    font-size: 0.95rem;
}

.dash-hero .muted strong {
    color: var(--text);
    font-weight: 700;
}

.dash-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    position: relative;
    z-index: 1;
    align-items: center;
}

.dash-welcome-actions .btn {
    min-height: 2.65rem;
    padding-inline: 1rem;
    border-radius: 12px;
    font-weight: 700;
}

.dash-hero-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
}

.dash-hero-btn:hover {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, transparent);
    background: var(--primary-soft);
    transform: translateY(-2px);
}

html[data-theme="light"] .dash-hero-btn {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
}

html[data-theme="light"] .dash-hero-btn:hover {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: #eff6ff;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.95rem 1rem 1rem;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    text-decoration: none;
    color: var(--text);
    min-height: 0;
    transition:
        border-color var(--dur) var(--ease),
        transform 0.28s var(--ease-out),
        background var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);
    animation: metricIn 0.5s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 0.06s);
}

@keyframes metricIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.metric-card:hover {
    border-color: rgba(96, 165, 250, 0.45);
    color: var(--text);
    transform: translateY(-4px);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.metric-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #bfdbfe;
}

.metric-chip.muted-chip {
    background: var(--badge-muted-bg);
    color: var(--muted);
    border-color: var(--border);
}

.metric-chip.success-chip {
    background: var(--success-soft);
    color: var(--success);
    border-color: #a7f3d0;
}

.metric-chip.warn-chip {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecaca;
}

.metric-ico {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 750;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.metric-ico-blue { background: rgba(59, 130, 246, 0.16); color: #60a5fa; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.07); }
.metric-ico-green { background: rgba(52, 211, 153, 0.14); color: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.07); }
.metric-ico-purple { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.07); }
.metric-ico-red { background: rgba(251, 113, 133, 0.14); color: #fb7185; box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.07); }
.metric-ico .ico { width: 18px; height: 18px; }

.metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.metric-label {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
    margin-top: 0.35rem;
    letter-spacing: -0.02em;
}

.metric-hint {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    margin-top: 0.15rem;
}

.dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.85fr);
    gap: 1.1rem;
    align-items: start;
    width: 100%;
}

.dash-main,
.dash-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.dash-panel {
    height: auto;
}

.chart-panel {
    min-height: 0;
}

.dash-panel .panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.panel-sub {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.panel-link {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(147, 197, 253, 0.18);
    background: rgba(59, 130, 246, 0.08);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.panel-link:hover {
    color: var(--primary-hover);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.plan-panel .plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan-price {
    margin: 0 0 0.85rem !important;
    font-size: 0.86rem !important;
}

.chart-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 1rem;
    align-items: stretch;
}

.chart-svg-box {
    min-width: 0;
}

.activity-chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.legend-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.legend-ok { background: rgba(52, 211, 153, 0.14); color: #34d399; }
.legend-bad { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.legend-info { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }

.legend-item strong {
    display: block;
    font-size: 0.84rem;
}

.legend-item span {
    color: var(--muted);
    font-size: 0.75rem;
}

.legend-item em {
    font-style: normal;
    font-weight: 700;
}

.delta-up { color: #34d399; }
.delta-down { color: #f87171; }

.plan-checks {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.plan-checks li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
}

.plan-checks .ico { color: #34d399; }

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 650;
    font-size: 0.88rem;
    letter-spacing: -0.015em;
    transition:
        border-color var(--dur) var(--ease),
        background var(--dur) var(--ease),
        transform var(--dur) var(--ease-out);
    font-weight: 650;
    font-size: 0.88rem;
}

.quick-link:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--text);
    background: rgba(59, 130, 246, 0.08);
    transform: translateX(3px);
}

.app-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.app-footer-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.15rem;
}

.app-footer nav {
    display: flex;
    gap: 0.9rem;
}

.app-footer a { color: var(--muted); }
.app-footer a:hover { color: var(--primary); }

.app-footer-social {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.app-footer-social .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    color: var(--muted);
    background: color-mix(in srgb, var(--border) 65%, transparent);
    border: 1px solid var(--border);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.app-footer-social .social-link:hover {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.pay-methods-footer {
    margin-top: 0;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

.pay-methods-footer .pay-methods-label {
    font-size: 0.7rem;
}

.pay-methods-footer .pay-method {
    min-height: 2.35rem;
    font-size: 0.76rem;
}

.pay-methods-footer .pay-method img {
    width: 1.6rem;
    height: 1.6rem;
}

.pay-methods-footer .pay-method.is-fastpay img {
    width: 4.6rem;
    height: 1.5rem;
}

.empty-state-sm {
    padding: 2rem 1rem;
}

.empty-illu {
    width: 72px;
    height: 72px;
    margin: 0 auto 0.85rem;
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.35), transparent 50%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(59, 130, 246, 0.12));
    border: 1px solid var(--border);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.4rem;
    background: #60a5fa;
    flex-shrink: 0;
}

.activity-dot-success { background: #34d399; }
.activity-dot-error { background: #f87171; }
.activity-dot-received,
.activity-dot-info { background: #60a5fa; }
.activity-dot-pending { background: #fb923c; }

.activity-item strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 650;
}

.activity-item small {
    color: var(--muted);
    font-size: 0.75rem;
}

.platform-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.platform-pill {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
}

.platform-pill-fb { color: #60a5fa; }
.platform-pill-ig { color: #c084fc; }

.more-menu {
    position: relative;
    display: inline-block;
}

.more-menu > summary {
    list-style: none;
}

.more-menu > summary::-webkit-details-marker { display: none; }

.more-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.more-btn:hover {
    color: var(--text);
    border-color: rgba(59, 130, 246, 0.4);
}

.more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 128px;
    background: #121a2b;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 0.35rem;
    z-index: 8;
}

.more-panel a,
.more-panel button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.more-panel a:hover,
.more-panel button:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--text);
}

.plan-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0.55rem 0 0.2rem;
}

.plan-list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.plan-list li { margin-bottom: 0.35rem; }

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.btn-with-brands {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-brands {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.btn-brand {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
}

.btn-brand .ico {
    width: 12px;
    height: 12px;
}

.btn-brand-fb { background: #1877f2; }
.btn-brand-ig {
    background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af);
}

.side-empty {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
}

/* Content */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.page-header .muted {
    margin: 0.3rem 0 0;
    max-width: 52ch;
    font-size: 0.92rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.05rem 1.1rem;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.card-narrow { max-width: 620px; }

.empty-state {
    text-align: center;
    padding: 2.75rem 1rem;
}

.empty-state p {
    color: var(--muted);
    margin: 0.5rem auto 1.2rem;
    max-width: 34ch;
}

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.55rem;
    font-weight: 650 !important;
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.78rem 0.95rem;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
    color-scheme: inherit;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--border-strong);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: var(--focus-ring);
    background: #fff;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.15rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.68rem 1.15rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: -0.015em;
    cursor: pointer;
    text-decoration: none;
    transition:
        background var(--dur) var(--ease),
        border-color var(--dur) var(--ease),
        color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease),
        transform 0.22s var(--ease-out);
}

.btn:hover { text-decoration: none; }

.btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.985);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-color: transparent;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 12px 26px rgba(37, 99, 235, 0.34);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.btn-danger {
    background: linear-gradient(180deg, #fb8a8a, #ef4444);
    color: #fff;
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.22);
}

.btn-danger:hover {
    filter: brightness(1.06);
    color: #fff;
    transform: translateY(-1px);
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 10px;
}

.btn:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.75);
    outline-offset: 2px;
}

button.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

/* Alerts */
.alert {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.92rem;
    animation: contentRise 0.35s var(--ease-out) both;
}

.alert-success {
    background: var(--success-soft);
    border-color: transparent;
    color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    border-color: transparent;
    color: var(--danger);
}

.error-list {
    margin: 0;
    padding-left: 1.1rem;
}

.callout-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(14, 165, 233, 0.06));
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: var(--text);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
    font-size: 0.92rem;
}

.callout-info a { font-weight: 650; }

/* Table */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.85rem 0.6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 650;
}

.data-table tbody tr {
    transition: background var(--dur) var(--ease);
}

.data-table tbody tr:hover {
    background: var(--table-hover);
}

.reply-cell {
    max-width: 240px;
    word-break: break-word;
    color: var(--muted);
}

code {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.84em;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 650;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-muted {
    background: var(--badge-muted-bg);
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.05rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stat-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

.feature-list {
    margin: 0.65rem 0 0.85rem;
    padding-left: 1.15rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.feature-list li { margin-bottom: 0.35rem; }

.page-choice {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.65rem;
    cursor: pointer;
    background: var(--surface-solid);
}

.page-choice:hover {
    border-color: var(--primary);
}

.page-choice input { margin-top: 0.2rem; }
.page-choice .help-text { display: block; }

/* Responsive */
@media (max-width: 960px) {
    .auth-wrap { grid-template-columns: 1fr; }

    .auth-showcase {
        min-height: 180px;
        padding: 1.35rem 1.15rem;
        justify-content: center;
        border-right: 0;
    }

    .auth-brand {
        display: block;
        margin-bottom: 1rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        z-index: 6;
        touch-action: manipulation;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        height: 100dvh;
        z-index: 40;
        width: min(var(--sidebar-width), 86vw);
        transform: translateX(-105%);
        transition: transform 0.22s var(--ease);
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.35);
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        touch-action: manipulation;
    }

    /* Never force-show while [hidden] — that blocked all phone taps. */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        background: var(--surface-muted);
    }

    body.menu-open .sidebar-backdrop,
    .sidebar-backdrop:not([hidden]) {
        display: block;
    }

    body.menu-open { overflow: hidden; touch-action: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: stretch; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .dash-layout { grid-template-columns: 1fr; }
    .chart-wrap { grid-template-columns: 1fr; }
    .top-search { max-width: none; flex: 1; min-width: 0; }
    .topbar { padding: 0.7rem 0.85rem; gap: 0.55rem; }
    .top-user-name { display: none; }
    .app-footer {
        align-items: stretch;
        gap: 0.65rem;
        padding: 1rem 1rem 1.35rem;
    }

    .app-footer-main {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .metric-grid { grid-template-columns: 1fr; }

    .top-search { display: none; }

    .btn, .nav-link, .icon-btn, .menu-toggle {
        touch-action: manipulation;
    }

    .insights-hero,
    .insights-grid,
    .history-layout,
    .history-split,
    .admin-grid,
    .admin-grid-user {
        grid-template-columns: 1fr;
    }

    .history-date,
    .history-select {
        width: 100%;
        min-width: 0;
    }

    .history-date-field,
    .history-select {
        width: 100%;
    }

    .history-date-field input,
    .history-select select {
        width: 100%;
        min-width: 0;
    }

}

@media (max-width: 700px) {
    .main-content { padding: 0.95rem 0.9rem 1.5rem; }

    .data-table thead { display: none; }

    .data-table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 0.75rem;
        padding: 0.25rem 0.55rem;
        background: var(--surface-solid);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .data-table td:last-child { border-bottom: 0; }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 650;
        color: var(--muted);
        flex-shrink: 0;
    }

    .reply-cell { max-width: none; }

    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Billing plans (match landing) */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.faq-item {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    padding: 0.15rem 1rem;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 0.95rem 0;
    font-weight: 650;
    color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    float: right;
    color: var(--muted);
    font-weight: 700;
}

.faq-item[open] summary::after { content: "–"; }

.faq-item p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.billing-shell {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    width: 100%;
    padding-bottom: 0.5rem;
}

.billing-plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    width: 100%;
    align-items: stretch;
}

.billing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
    padding: 1.25rem 1.15rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, var(--surface-muted), var(--surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 14px 30px rgba(2, 6, 23, 0.16);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.billing-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 36px rgba(2, 6, 23, 0.22);
}

.billing-card.is-featured {
    border-color: rgba(96, 165, 250, 0.45);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(37, 99, 235, 0.28), transparent 55%),
        linear-gradient(165deg, #1e3a8a 0%, #1d4ed8 48%, #2563eb 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 20px 42px rgba(37, 99, 235, 0.32);
}

.billing-card.is-featured:hover {
    border-color: rgba(147, 197, 253, 0.55);
}

.billing-card-badge {
    position: absolute;
    top: 0.9rem;
    inset-inline-end: 0.9rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.billing-card-badge.is-popular {
    border: 1px solid rgba(251, 146, 60, 0.45);
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
}

.billing-card-badge.is-save {
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

.billing-card.is-featured .billing-card-badge.is-popular {
    border-color: rgba(253, 186, 116, 0.55);
    background: rgba(255, 255, 255, 0.16);
    color: #fed7aa;
}

.billing-card.is-featured .billing-card-badge.is-save {
    border-color: rgba(167, 243, 208, 0.5);
    background: rgba(255, 255, 255, 0.14);
    color: #a7f3d0;
}

.billing-card-top {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-inline-end: 4.5rem;
}

.billing-card-top h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text);
}

.billing-card.is-featured .billing-card-top h2 {
    color: #fff;
}

.billing-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
}

.billing-price strong {
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.billing-price span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
}

.billing-card.is-featured .billing-price strong {
    color: #fff;
}

.billing-card.is-featured .billing-price span {
    color: rgba(226, 232, 240, 0.88);
}

.billing-save {
    margin: 0;
    color: #6ee7b7;
    font-size: 0.78rem;
    font-weight: 700;
}

.billing-card.is-featured .billing-save {
    color: #a7f3d0;
}

.billing-features {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.billing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 550;
    line-height: 1.4;
}

.billing-features .ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: #34d399;
}

.billing-card.is-featured .billing-features li {
    color: rgba(255, 255, 255, 0.95);
}

.billing-card.is-featured .billing-features .ico {
    color: #fff;
}

.billing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    margin-top: auto;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(37, 211, 102, 0.35);
    background: rgba(37, 211, 102, 0.14);
    color: #86efac;
    font-size: 0.9rem;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.billing-cta .ico {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.billing-cta:hover {
    background: rgba(37, 211, 102, 0.24);
    border-color: rgba(37, 211, 102, 0.55);
    color: #bbf7d0;
    text-decoration: none;
    transform: translateY(-1px);
}

.billing-cta.is-solid {
    border-color: transparent;
    background: #25d366;
    color: #052e16;
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.28);
}

.billing-cta.is-solid:hover {
    background: #22c55e;
    color: #022c22;
    text-decoration: none;
}

.pay-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(180deg, var(--surface-muted), var(--surface));
    text-align: center;
}

.pay-methods-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pay-methods-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pay-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.65rem;
    padding: 0.35rem 0.75rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.pay-method img {
    width: 1.85rem;
    height: 1.85rem;
    object-fit: contain;
    border-radius: 8px;
    background: var(--surface-muted);
    flex-shrink: 0;
}

.pay-method.is-fastpay {
    padding: 0.35rem 0.7rem;
    border-color: rgba(236, 72, 153, 0.4);
    background: transparent;
    box-shadow: none;
}

.pay-method.is-fastpay img {
    width: 5.4rem;
    height: 1.75rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
}

.pay-method.is-fib {
    border-color: rgba(79, 180, 152, 0.35);
}

.pay-method.is-superqi {
    border-color: rgba(243, 205, 0, 0.35);
}

.pay-method-name {
    padding-inline-end: 0.25rem;
}

@media (max-width: 1100px) {
    .billing-plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .billing-plans {
        grid-template-columns: 1fr;
    }

    .billing-card-top {
        padding-inline-end: 5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* -------- Insights -------- */
.insights-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 1.1rem;
    margin-bottom: 1.15rem;
    align-items: stretch;
}

.insights-hero-copy {
    padding: 1.15rem 1.2rem;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background:
        radial-gradient(680px 200px at 90% -10%, rgba(56, 189, 248, 0.16), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
    animation: contentRise 0.45s var(--ease-out) both;
}

.insights-hero-copy h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.55rem, 2.3vw, 1.95rem);
    letter-spacing: -0.045em;
}

.insights-hero-copy .muted {
    margin: 0 0 1rem;
    max-width: 52ch;
}

.insights-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.insights-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.2rem;
}

.insights-ring {
    position: relative;
    width: 108px;
    height: 108px;
    flex-shrink: 0;
}

.insights-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.insights-ring-track {
    fill: none;
    stroke: rgba(148, 163, 184, 0.16);
    stroke-width: 8;
}

.insights-ring-value {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s var(--ease);
}

.insights-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    line-height: 1.15;
}

.insights-ring-label strong {
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.insights-ring-label span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.insights-score-meta {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
}

.insights-score-meta span {
    display: block;
    font-size: 0.72rem;
    font-weight: 650;
}

.insights-score-meta strong {
    font-size: 0.98rem;
}

.text-danger { color: #f87171; }

.insights-metrics { margin-bottom: 1.15rem; }

.metric-card-static {
    cursor: default;
}

.metric-card-static:hover {
    transform: none;
}

.insights-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
    gap: 1.1rem;
    margin-bottom: 1.15rem;
    align-items: start;
}

.insights-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.insights-sub {
    margin: 0.2rem 0 0;
    font-size: 0.84rem;
}

.insights-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.insights-gridline {
    stroke: rgba(148, 163, 184, 0.1);
    stroke-width: 1;
}

.insights-health {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.insights-health-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.insights-health-row div {
    flex: 1;
    min-width: 0;
}

.insights-health-row strong {
    display: block;
    font-size: 0.9rem;
}

.insights-health-row small {
    color: var(--muted);
    font-size: 0.75rem;
}

.insights-health-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.insights-bars {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.insights-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
}

.insights-bar-label span { color: var(--muted); font-weight: 600; }

.insights-bar-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.insights-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.insights-bar-dm span {
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
}

.insights-feed { margin-bottom: 0.5rem; }

.insights-empty {
    text-align: center;
    padding: 2.25rem 1rem 1.75rem;
}

.insights-empty-ico {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

.insights-empty h3 { margin: 0 0 0.35rem; }
.insights-empty .muted { margin: 0 auto 1rem; max-width: 42ch; }
.insights-empty .dash-welcome-actions { justify-content: center; }

.insights-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.35rem;
}

.insights-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.insights-timeline-item:last-child { border-bottom: 0; }

.insights-timeline-body { flex: 1; min-width: 0; }

.insights-timeline-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.insights-timeline-top strong {
    font-size: 0.9rem;
    line-height: 1.35;
}

.insights-timeline-body small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.insights-chip {
    flex-shrink: 0;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

@media (max-width: 960px) {
    .insights-hero,
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

.section-kicker {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

/* -------- Insights date range tabs -------- */
.insights-range {
    margin: 0 0 1.1rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.insights-range-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    padding: 0.28rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.insights-range-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.insights-range-tab:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.insights-range-tab.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

.insights-range-hint {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
}

.insights-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
}

.insights-custom label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--muted);
}

.insights-custom input[type="date"] {
    min-width: 10.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

@media (max-width: 720px) {
    .insights-range-tabs {
        width: 100%;
        border-radius: 16px;
    }

    .insights-range-tab {
        flex: 1 1 auto;
        padding: 0.5rem 0.7rem;
        font-size: 0.82rem;
    }
}

/* -------- Comment history + mini dashboard -------- */
.history-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin: 1rem 0 0.75rem;
    padding: 0.95rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    background:
        radial-gradient(420px 140px at 100% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
}

.history-hero h1 {
    margin: 0 0 0.2rem;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    letter-spacing: -0.04em;
}

.history-hero .muted {
    margin: 0;
    max-width: 56ch;
    font-size: 0.9rem;
}

.history-range {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0.85rem;
}

.history-filters,
.history-filters-modern {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
    padding: 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface);
}

.history-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.history-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.history-search-ico {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.history-search-ico .ico { width: 16px; height: 16px; }

.history-search input {
    width: 100%;
    padding: 0.7rem 0.9rem 0.7rem 2.45rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface-muted);
    color: var(--text);
    font: inherit;
}

.history-search input:focus,
.history-date-field:focus-within,
.history-date-range:focus-within,
.history-select:focus-within {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.history-date {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 650;
}

.history-date-range {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.7rem;
    padding: 0.35rem 0.7rem 0.35rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface-muted);
    flex: 0 1 auto;
}

.history-date-range-ico {
    display: grid;
    place-items: center;
    color: #93c5fd;
    flex-shrink: 0;
}

.history-date-range-ico .ico {
    width: 15px;
    height: 15px;
}

.history-date-modern {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.08rem;
    min-width: 0;
    margin: 0;
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8aa0bc;
}

.history-date-modern input[type="date"] {
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    text-transform: none;
    min-width: 8.6rem;
    padding: 0;
    color-scheme: inherit;
}

.history-date-modern input[type="date"]:focus {
    outline: none;
}

.history-date-sep {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.history-date-field {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    color: var(--muted);
}

.history-date-field .ico { width: 15px; height: 15px; }

.history-date-field input {
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    min-width: 9.5rem;
}

.history-date-field input:focus { outline: none; }

.history-apply-btn {
    margin-left: auto;
}

.history-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 10.5rem;
    padding: 0.55rem 2rem 0.55rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
}

.history-select-ico {
    color: var(--muted);
    display: grid;
    place-items: center;
}

.history-select-ico .ico { width: 15px; height: 15px; }

.history-select select {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    color-scheme: inherit;
}

.history-select select:focus { outline: none; }

.history-select select option,
.history-select select optgroup,
.form-group select option {
    background-color: var(--surface-muted);
    color: #e8eef8;
}

.history-select-chevron {
    position: absolute;
    right: 0.55rem;
    width: 14px !important;
    height: 14px !important;
    color: var(--muted);
    pointer-events: none;
}

.history-select-muted {
    opacity: 0.55;
}

.history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 1.1rem;
    align-items: start;
}

.history-main {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

.history-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.history-empty-line {
    margin: 1.25rem 0 0.35rem;
}

.coverage-card h2 {
    margin: 0.15rem 0 0.45rem;
    font-size: 1.05rem;
}

.coverage-stat {
    margin: 0.35rem 0 0.15rem;
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #f87171;
}

.coverage-stat:not(.is-alert) {
    color: #94a3b8;
}

.coverage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.coverage-meta span {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.history-dash {
    padding: 1.1rem 1rem;
    position: sticky;
    top: 1rem;
}

.history-dash > h2 {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
}

.mini-dash-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.mini-dash-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface-muted);
}

.mini-dash-row > span {
    font-weight: 700;
    font-size: 0.95rem;
}

.mini-dash-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.mini-dash-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mini-dash-track {
    fill: none;
    stroke: rgba(45, 212, 191, 0.18);
    stroke-width: 3.5;
}

.mini-dash-value {
    fill: none;
    stroke: #2dd4bf;
    stroke-width: 3.5;
    stroke-linecap: round;
}

.mini-dash-ring strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mini-dash-extras {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.95rem;
}

.mini-dash-extras span {
    display: block;
    font-size: 0.7rem;
    font-weight: 650;
}

.mini-dash-extras strong {
    font-size: 0.92rem;
}

@media (max-width: 1100px) {
    .history-layout {
        grid-template-columns: 1fr;
    }

    .history-dash {
        position: static;
    }
}

@media (max-width: 820px) {
    .history-split {
        grid-template-columns: 1fr;
    }
}

/* -------- Admin console -------- */
.admin-body .admin-sidebar {
    padding: 1rem 0.75rem 0.85rem;
    background-color: var(--sidebar-bg);
    background-image: linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 24%);
    border-right: 1px solid var(--border);
    color: var(--sidebar-text);
}

.admin-sidebar-brand {
    margin-bottom: 1.15rem;
    padding: 0.15rem 0.25rem;
}

.admin-sidebar-brand a {
    gap: 0.7rem;
    padding: 0.45rem 0.5rem;
    border-radius: 14px;
}

.admin-sidebar-brand .brand-logo {
    box-shadow: none;
    background: transparent;
}

.admin-sidebar-brand .brand-text strong {
    color: var(--sidebar-text);
}

.admin-sidebar-brand .brand-text small {
    color: var(--primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.62rem;
    font-weight: 700;
}

.admin-sidebar-nav {
    gap: 0;
    padding-inline-end: 0.1rem;
}

.admin-sidebar-nav .nav-group {
    gap: 0.2rem;
}

.admin-sidebar-nav .nav-group + .nav-group {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-sidebar-nav .nav-group-label {
    padding: 0 0.7rem 0.5rem;
    color: var(--sidebar-muted);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.admin-sidebar .nav-link {
    position: relative;
    gap: 0.7rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--sidebar-muted);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transform: none;
}

.admin-sidebar .nav-link:hover {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
    border-color: transparent;
    transform: none;
}

.admin-sidebar .nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 22%, transparent);
    box-shadow: none;
}

.admin-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: 3px;
    height: 1.15rem;
    border-radius: 999px;
    background: var(--primary);
    transform: translateY(-50%);
}

.admin-sidebar .nav-ico {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(148, 163, 184, 0.1);
    color: var(--sidebar-muted);
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.admin-sidebar .nav-link:hover .nav-ico {
    background: rgba(148, 163, 184, 0.16);
    color: var(--sidebar-text);
}

.admin-sidebar .nav-link.active .nav-ico {
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
}

.admin-sidebar .nav-ico .ico {
    width: 15px;
    height: 15px;
    opacity: 1;
}

.admin-sidebar .nav-label {
    min-width: 0;
    line-height: 1.25;
}

.admin-sidebar .nav-link-exit {
    color: var(--sidebar-muted);
}

.admin-sidebar .nav-link-exit:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}

.admin-sidebar .nav-link-exit:hover .nav-ico {
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
}

.admin-sidebar-footer {
    padding-top: 0.75rem;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.06), transparent 55%),
        var(--surface-muted);
}

.admin-user-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.admin-user-meta strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sidebar-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-meta small {
    font-size: 0.68rem;
    color: var(--sidebar-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-role {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}

.nav-section-label {
    margin: 0.35rem 0.85rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.admin-badge-card {
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
        var(--surface-muted);
}

html[dir="rtl"] .admin-sidebar .nav-link:hover {
    transform: none;
}

.admin-shell .admin-topbar {
    min-height: 4.15rem;
    padding: 0.7rem 1.25rem;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background:
        linear-gradient(180deg, var(--surface), var(--surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 10px 28px rgba(2, 6, 23, 0.18);
}

.admin-top-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    min-width: 0;
    margin-inline-end: auto;
    margin-inline-start: 0.15rem;
}

.admin-top-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.admin-top-page {
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(52vw, 28rem);
}

.admin-shell .lang-switch-top .lang-name {
    display: inline;
}

.admin-topbar-right {
    gap: 0.65rem;
}

.admin-top-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-block: 0.28rem;
    padding-inline: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface-muted);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.admin-top-user:hover {
    border-color: rgba(45, 212, 191, 0.28);
    background: rgba(45, 212, 191, 0.06);
}

.admin-top-avatar {
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    color: #ecfdf5;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.4), rgba(15, 118, 110, 0.65));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.admin-top-avatar-photo {
    object-fit: cover;
    padding: 0;
    background: var(--surface-muted);
    display: block;
}

.admin-top-user-meta {
    display: none;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.admin-top-user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    max-width: 9.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

.admin-top-user-role {
    font-size: 0.66rem;
    font-weight: 650;
    color: var(--primary);
}

@media (min-width: 700px) {
    .admin-top-user-meta { display: flex; }
}

@media (max-width: 700px) {
    .admin-top-page {
        max-width: 42vw;
        font-size: 0.95rem;
    }

    .admin-top-user {
        padding: 0.22rem;
    }

    .admin-shell .admin-topbar {
        min-height: 3.7rem;
        padding: 0.6rem 0.85rem;
    }
}

.admin-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
    padding: 1.25rem 1.35rem;
    border-radius: 18px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    background:
        radial-gradient(700px 180px at 100% 0%, rgba(45, 212, 191, 0.18), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
}

.admin-hero h1 { margin: 0 0 0.3rem; font-size: clamp(1.4rem, 2vw, 1.75rem); }
.admin-hero .muted { margin: 0; max-width: 52ch; }

.admin-settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.admin-settings-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
    box-shadow: var(--shadow);
    width: fit-content;
    max-width: 100%;
}

.admin-settings-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-settings-menu-link:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.admin-settings-menu-link.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent);
}

.admin-settings-menu-link .ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.admin-settings-panel {
    min-width: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    align-items: start;
}

.admin-grid-user {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.85fr);
}

.admin-user-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* -------- Admin users list / detail -------- */
.admin-users-shell {
    padding: 0;
    overflow: hidden;
}

.admin-users-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1.05rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background: var(--surface-muted);
}

.admin-users-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: min(100%, 18rem);
}

.admin-users-search-field {
    position: relative;
    flex: 1;
    min-width: 12rem;
}

.admin-users-search-ico {
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.admin-users-search-field input {
    width: 100%;
    min-height: 2.45rem;
    padding: 0.55rem 0.9rem 0.55rem 2.35rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--input-bg);
    color: var(--text);
}

.admin-users-search-field input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.admin-users-count {
    margin: 0;
    font-size: 0.78rem;
    white-space: nowrap;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.4fr) auto;
    gap: 0.85rem 1rem;
    align-items: center;
    padding: 0.95rem 1.05rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    transition: background 0.15s ease;
}

.admin-user-row:last-child {
    border-bottom: 0;
}

.admin-user-row:hover {
    background: rgba(148, 163, 184, 0.05);
}

.admin-user-row-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.admin-user-row-avatar,
.admin-user-hero-avatar {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    color: #e0f2fe;
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.42));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-user-row-avatar-photo,
.admin-user-hero-avatar-photo {
    object-fit: cover;
    padding: 0;
    background: var(--surface-muted);
    display: block;
    box-shadow: none;
}

.admin-user-row-copy {
    min-width: 0;
}

.admin-user-row-title,
.admin-user-hero-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.admin-user-row-title strong,
.admin-user-hero-title h1 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-row-id {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
}

.admin-user-row-email,
.admin-user-hero-email {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-row-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin-top: 0.35rem;
}

.admin-user-row-page {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text);
}

.admin-user-row-page .ico {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.9;
}

.admin-user-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.admin-user-row-joined {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
}

.admin-user-row-action {
    justify-self: end;
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.admin-pill-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: currentColor;
}

.admin-pill-ok {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
}

.admin-pill-warn {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}

.admin-pill-admin {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
}

.admin-pill-plan {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
}

.admin-pill-muted {
    color: var(--muted);
}

.admin-users-empty {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 3rem 1.25rem;
    text-align: center;
}

.admin-users-empty-ico {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-bottom: 0.35rem;
    color: var(--primary);
    background: var(--primary-soft);
}

.admin-users-empty strong {
    color: var(--text);
}

.admin-user-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding: 1.15rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.08), transparent 42%),
        var(--surface-muted);
    box-shadow: var(--shadow);
}

.admin-user-hero-main {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.admin-user-hero-avatar {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 16px;
    font-size: 0.92rem;
}

.admin-user-hero-copy {
    min-width: 0;
}

.admin-user-hero-title h1 {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.admin-user-hero-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.admin-user-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.admin-user-panel-head h2 {
    margin: 0;
    font-size: 1rem;
}

.admin-user-panel-head .panel-sub {
    margin: 0.2rem 0 0;
}

.admin-user-panel-ico {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.16);
}

.admin-user-panel-ico.is-danger {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.2);
}

.admin-user-meta-empty,
.admin-user-meta-card {
    margin-top: 0.85rem;
}

.admin-user-meta-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface-muted);
}

.admin-user-meta-asset {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.admin-user-meta-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-muted);
}

.admin-user-meta-logo-fallback {
    display: grid;
    place-items: center;
    color: #e2e8f0;
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.38));
}

.admin-user-meta-asset strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
}

.admin-user-meta-asset small {
    display: block;
    margin-top: 0.1rem;
}

.admin-user-meta-card strong {
    color: var(--text);
}

.admin-conn-asset {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.admin-conn-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-muted);
}

.admin-conn-logo-fallback {
    display: grid;
    place-items: center;
    color: #e2e8f0;
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.38));
}

.admin-conn-asset strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.2;
}

.admin-conn-asset small {
    display: block;
    margin-top: 0.12rem;
}

.danger-zone {
    border-color: rgba(244, 63, 94, 0.22);
    background:
        linear-gradient(180deg, rgba(244, 63, 94, 0.08), transparent 55%),
        var(--surface);
}

.danger-zone h2 { color: var(--danger); }

@media (max-width: 980px) {
    .admin-user-row {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .admin-user-row-action {
        justify-self: start;
    }
}

/* -------- Admin activity -------- */
.admin-activity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-activity-shell {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-activity-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1.05rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-activity-search {
    position: relative;
    flex: 1 1 16rem;
    min-width: 0;
}

.admin-activity-search-ico {
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.admin-activity-search input {
    width: 100%;
    min-height: 2.45rem;
    padding: 0.55rem 0.9rem 0.55rem 2.35rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--input-bg);
    color: var(--text);
}

.admin-activity-search input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.admin-activity-count {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.admin-activity-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.admin-activity-empty strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.admin-activity-empty p {
    margin: 0;
    color: var(--muted);
}

.admin-activity-table {
    width: 100%;
}

.admin-activity-head,
.admin-activity-item {
    display: grid;
    grid-template-columns: 7.5rem 6.5rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1.05rem;
}

.admin-activity-head {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-activity-item {
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
}

.admin-activity-item:last-child {
    border-bottom: 0;
}

.admin-activity-item:hover {
    background: rgba(148, 163, 184, 0.04);
}

.admin-activity-cell {
    min-width: 0;
    font-size: 0.86rem;
    color: var(--text);
}

.admin-activity-cell.is-when {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.admin-activity-cell.is-message {
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.admin-activity-cell.is-event code {
    display: inline-block;
    max-width: 100%;
    padding: 0.18rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.admin-activity-cell.is-user a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.admin-activity-cell.is-user a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.admin-activity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: lowercase;
}

.admin-activity-badge.is-success {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
}

.admin-activity-badge.is-error {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.22);
}

.admin-activity-badge.is-warn {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}

.admin-activity-badge.is-info {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.2);
}

@media (max-width: 980px) {
    .admin-activity-head {
        display: none;
    }

    .admin-activity-item {
        grid-template-columns: 1fr;
        gap: 0.45rem;
        padding: 1rem 1.05rem;
    }

    .admin-activity-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        color: #64748b;
        font-size: 0.65rem;
        font-weight: 750;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
}

.admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.admin-check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 0.9rem;
    margin-bottom: 0.75rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface-muted);
    cursor: pointer;
}

.admin-check input { margin-top: 0.2rem; }
.admin-check strong { display: block; }
.admin-check small { display: block; margin-top: 0.2rem; }

.admin-social-fieldset {
    margin: 0.35rem 0 1rem;
    padding: 0.9rem 1rem 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: var(--surface-muted);
}

.admin-social-fieldset legend {
    padding: 0 0.35rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
}

.admin-social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
}

.admin-social-grid .form-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 720px) {
    .admin-social-grid {
        grid-template-columns: 1fr;
    }
}

.admin-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.admin-plan-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    padding: 1rem;
    background: var(--surface-muted);
}

.admin-plan-card.is-featured {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.admin-plan-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.85rem;
}

.admin-plan-card-head strong {
    font-size: 1.05rem;
}

.admin-plan-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.admin-plan-toggles .admin-check {
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .admin-plans-grid {
        grid-template-columns: 1fr;
    }
}

.admin-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.admin-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-status-row:last-child { border-bottom: 0; }

.admin-status-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-status-label .ico,
.page-header h1 .ico,
.ao-health-list .ico,
.feature-list .ico {
    color: #66b2ff;
}

.auth-showcase p {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.auth-showcase p .ico {
    margin-top: 0.2rem;
    color: #66b2ff;
}

@media (max-width: 960px) {
    .admin-grid,
    .admin-grid-user,
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

.billing-hero {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
        linear-gradient(180deg, var(--surface), var(--surface));
}

.billing-hero .section-kicker {
    margin: 0 0 0.25rem;
}

.billing-hero h1 {
    margin: 0 0 0.3rem;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    letter-spacing: -0.02em;
}

.billing-hero .muted {
    margin: 0;
    max-width: 48ch;
}

/* -------- Admin API & Secrets -------- */
.admin-api-header {
    margin-bottom: 0.85rem;
    align-items: center;
}

.admin-api-header .muted {
    margin: 0.2rem 0 0;
    max-width: 52ch;
}

.admin-api-shell {
    width: 100%;
    max-width: none;
    padding: 0.15rem 1.15rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-api-block {
    padding: 0.95rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.admin-api-block:last-of-type {
    border-bottom: 0;
}

.admin-api-block h2 {
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
}

.admin-api-hint {
    margin: -0.15rem 0 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.35;
}

.admin-api-block .admin-check {
    margin-bottom: 0;
}

.admin-api-block .form-group {
    margin-bottom: 0.75rem;
}

.admin-api-block .form-group:last-child {
    margin-bottom: 0;
}

.admin-api-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.9rem;
    padding-top: 0.85rem;
}

.admin-api-actions .muted {
    margin: 0;
    font-size: 0.78rem;
}

.secret-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.secret-label-row label { margin: 0; }

.secret-label-row .btn-sm {
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
}

/* -------- Admin overview (advanced) -------- */
.ao-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    gap: 1.1rem;
    margin-bottom: 1.15rem;
    align-items: stretch;
}

.ao-hero-copy {
    padding: 1.35rem 1.4rem;
    border-radius: 20px;
    border: 1px solid rgba(45, 212, 191, 0.22);
    background:
        radial-gradient(720px 220px at 100% -10%, rgba(45, 212, 191, 0.2), transparent 55%),
        radial-gradient(520px 180px at 0% 100%, rgba(59, 130, 246, 0.14), transparent 50%),
        var(--surface);
    box-shadow: var(--shadow);
}

.ao-hero-copy h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}

.ao-hero-copy .muted {
    margin: 0 0 0.9rem;
    max-width: 54ch;
}

.ao-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.ao-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
}

.ao-pill.is-live {
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
}

.ao-pill.is-off,
.ao-pill.is-warn {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.ao-health {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.2rem;
}

.ao-health-ring {
    position: relative;
    width: 104px;
    height: 104px;
    flex-shrink: 0;
}

.ao-health-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ao-ring-track {
    fill: none;
    stroke: rgba(148, 163, 184, 0.16);
    stroke-width: 8;
}

.ao-ring-value {
    fill: none;
    stroke: #2dd4bf;
    stroke-width: 8;
    stroke-linecap: round;
}

.ao-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    line-height: 1.1;
}

.ao-ring-label strong {
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.ao-ring-label span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.ao-health-copy {
    flex: 1;
    min-width: 0;
}

.ao-health-copy h2 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
}

.ao-health-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ao-health-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.84rem;
}

.ao-health-list span { color: var(--muted); font-weight: 600; }
.ao-health-list .ok { color: #5eead4; }
.ao-health-list .bad { color: #f87171; }

.ao-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.05rem;
}

.ao-kpi {
    padding: 1.05rem 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ao-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.ao-kpi-ico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
}

.ao-kpi-blue { background: var(--primary-soft); color: var(--primary); }
.ao-kpi-teal { background: var(--success-soft); color: var(--success); }
.ao-kpi-purple { background: rgba(124, 58, 237, 0.14); color: #7c3aed; }
.ao-kpi-rose { background: var(--danger-soft); color: var(--danger); }

html:not([data-theme="light"]) .ao-kpi-blue { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
html:not([data-theme="light"]) .ao-kpi-teal { background: rgba(45, 212, 191, 0.16); color: #5eead4; }
html:not([data-theme="light"]) .ao-kpi-purple { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
html:not([data-theme="light"]) .ao-kpi-rose { background: rgba(244, 63, 94, 0.14); color: #fda4af; }

.ao-kpi-delta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.ao-kpi-value {
    font-size: 1.85rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

.ao-kpi-label {
    font-weight: 700;
    font-size: 0.92rem;
    margin-top: 0.2rem;
}

.ao-kpi-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.ao-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.15rem;
}

.ao-action {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.ao-action:hover {
    border-color: rgba(45, 212, 191, 0.35);
    background: rgba(45, 212, 191, 0.08);
    text-decoration: none;
    transform: translateY(-1px);
}

.ao-action strong {
    display: block;
    font-size: 0.88rem;
}

.ao-action small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 0.1rem;
}

.ao-action-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    flex-shrink: 0;
}

.ao-main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.1rem;
    align-items: start;
}

.ao-chart-panel .chart-svg-box {
    margin-top: 0.15rem;
    padding: 0.55rem 0.35rem 0.2rem;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.04);
}

.ao-chart-line {
    stroke: var(--chart-line);
}

.ao-chart-dot {
    fill: var(--chart-line-soft);
    stroke: var(--surface);
    stroke-width: 1.5;
}

.ao-mix {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ao-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.ao-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.55rem;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.ao-user-row:hover {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.12);
    text-decoration: none;
}

.ao-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(59, 130, 246, 0.72));
    color: #fff;
    font-weight: 750;
    font-size: 0.78rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.ao-user-meta {
    flex: 1;
    min-width: 0;
}

.ao-user-meta strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
}

.ao-user-meta small {
    color: var(--muted);
    font-size: 0.75rem;
    word-break: break-all;
}

.ao-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-end;
}

.ao-empty {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.ao-empty-ico {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
}

.ao-empty h3 { margin: 0 0 0.3rem; }
.ao-empty .muted { margin: 0 auto; max-width: 42ch; }

@media (max-width: 1100px) {
    .ao-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ao-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .ao-hero,
    .ao-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ao-actions,
    .ao-kpis {
        grid-template-columns: 1fr;
    }

    .ao-user-tags { display: none; }
}

/* -------- Facebook posts manager -------- */
.fb-hero {
    margin-bottom: 1rem;
    padding: 1.05rem 1.15rem;
    border-radius: 20px;
    border: 1px solid rgba(24, 119, 242, 0.28);
    background:
        radial-gradient(420px 160px at 0% 0%, rgba(24, 119, 242, 0.22), transparent 60%),
        linear-gradient(145deg, var(--surface-muted), var(--surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 14px 30px rgba(2, 6, 23, 0.2);
    animation: contentRise 0.45s var(--ease-out) both;
}

.fb-hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fb-hero-identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1;
}

.fb-hero-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--surface-muted);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.28);
}

.fb-hero-avatar-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1877f2);
}

.fb-hero-avatar-fallback .ico {
    width: 1.35rem;
    height: 1.35rem;
}

.fb-hero-copy {
    min-width: 0;
}

.fb-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.28rem;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fb-hero-platform {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #1877f2;
    color: #fff;
}

.fb-hero-platform .ico {
    width: 0.7rem;
    height: 0.7rem;
}

.fb-hero h1 {
    margin: 0 0 0.28rem;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: -0.04em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(70vw, 28rem);
}

.fb-hero .muted {
    margin: 0;
    max-width: 46ch;
    font-size: 0.88rem;
    line-height: 1.45;
}

.fb-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fb-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.4rem;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.fb-hero-btn:hover {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.fb-hero-btn-ghost {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.fb-hero-btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-muted);
}

@media (max-width: 700px) {
    .fb-hero-actions {
        width: 100%;
    }

    .fb-hero-btn {
        flex: 1;
        justify-content: center;
    }

    .fb-hero h1 {
        max-width: 58vw;
    }
}

.fb-control {
    margin-bottom: 1rem;
}

.fb-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.95rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.1), var(--surface-muted) 42%),
        var(--surface);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 28px rgba(2, 6, 23, 0.18);
}

.fb-toolbar-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fb-quota {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface-muted);
}

.fb-quota-kicker {
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
}

.fb-quota-value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    color: var(--text);
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.fb-quota-value em {
    font-style: normal;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.fb-quota-value span {
    color: var(--muted);
    font-weight: 650;
    font-size: 0.82rem;
}

.fb-quota-chip {
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.fb-quota.is-full .fb-quota-chip {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
}

.fb-quota.is-over .fb-quota-chip {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.fb-quota.is-over .fb-quota-value em {
    color: #fecaca;
}

.fb-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 180px;
    margin: 0;
}

.fb-search-ico {
    position: absolute;
    inset-inline-start: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: grid;
    place-items: center;
}

.fb-search input {
    width: 100%;
    height: 2.55rem;
    padding: 0 0.9rem 0 2.35rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 550;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

html[dir="rtl"] .fb-search input {
    padding: 0 2.35rem 0 0.9rem;
}

.fb-search input::placeholder {
    color: #64748b;
}

.fb-search input:focus {
    border-color: rgba(96, 165, 250, 0.55);
    background: var(--surface);
}

.fb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.fb-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.fb-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fb-chip span {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fb-chip.is-on span,
.fb-chip input:checked + span {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
}

.fb-chip:hover span {
    border-color: var(--border-strong);
    color: var(--text);
}

.fb-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-inline-start: auto;
}

.fb-bulk-btn {
    height: 2.35rem;
    padding: 0 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.fb-bulk-btn:hover {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    transform: translateY(-1px);
}

.fb-bulk-btn-muted {
    border-color: var(--border);
    background: var(--surface-muted);
    color: var(--muted);
}

.fb-bulk-btn-muted:hover {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.fb-post-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.fb-post-card {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(180deg, var(--surface-muted), var(--surface));
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 18px rgba(2, 6, 23, 0.14);
    transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.fb-post-card:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 24px rgba(2, 6, 23, 0.2);
}

.fb-post-card.is-on {
    border-width: 2px;
    border-color: #34d399;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 0 2px rgba(16, 185, 129, 0.22),
        0 8px 18px rgba(2, 6, 23, 0.14);
}

.fb-post-card.is-on:hover {
    border-color: #6ee7b7;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 2px rgba(16, 185, 129, 0.32),
        0 12px 24px rgba(2, 6, 23, 0.2);
}

.fb-post-card.is-off {
    opacity: 0.9;
    border-width: 2px;
    border-color: #f87171;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 0 0 2px rgba(239, 68, 68, 0.22),
        0 8px 18px rgba(2, 6, 23, 0.14);
}

.fb-post-card.is-off:hover {
    border-color: #fca5a5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 2px rgba(239, 68, 68, 0.32),
        0 12px 24px rgba(2, 6, 23, 0.2);
}

.fb-post-card.is-off .fb-post-banner {
    filter: grayscale(0.25) saturate(0.85);
}

.fb-post-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-muted);
}

.fb-post-media.is-empty {
    display: grid;
    place-items: center;
    background:
        radial-gradient(140px 90px at 50% 40%, rgba(59, 130, 246, 0.18), transparent 70%),
        var(--surface-muted);
}

.fb-post-empty {
    color: #64748b;
}

.fb-post-empty .ico {
    width: 22px;
    height: 22px;
}

.fb-post-banner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

.fb-post-top {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    right: 0.45rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.fb-post-platform {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #1877f2;
    color: #fff;
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.3);
}

.fb-post-platform .ico { width: 11px; height: 11px; }

.fb-post-state {
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.fb-post-state.is-on {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.fb-post-state.is-off {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.fb-post-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--surface-muted);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.fb-post-card.is-on .fb-post-actions,
.fb-post-card:hover .fb-post-actions,
.fb-post-card:focus-within .fb-post-actions {
    opacity: 1;
    pointer-events: auto;
}

.fb-post-card.is-off:hover .fb-post-actions,
.fb-post-card.is-off:focus-within .fb-post-actions {
    background: var(--surface-muted);
}

.fb-post-action {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    text-decoration: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
    transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.fb-post-action .ico {
    width: 14px;
    height: 14px;
}

.fb-post-action:hover {
    background: rgba(37, 99, 235, 0.92);
    border-color: rgba(147, 197, 253, 0.4);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px) scale(1.04);
}

.fb-post-action.is-primary {
    background: rgba(37, 99, 235, 0.92);
    border-color: rgba(147, 197, 253, 0.4);
}

.fb-post-badge {
    position: absolute;
    left: 0.45rem;
    bottom: 0.45rem;
    z-index: 2;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid rgba(147, 197, 253, 0.22);
    color: #93c5fd;
    font-size: 0.58rem;
    font-weight: 700;
}

.fb-post-foot {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.fb-post-title {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.fb-post-title:hover {
    text-decoration: none;
}

.fb-post-title strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-post-title:hover strong {
    color: var(--primary);
}

.fb-post-title small {
    display: block;
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-toggle {
    position: relative;
    width: 2.15rem;
    height: 1.15rem;
    display: inline-block;
    cursor: pointer;
    flex-shrink: 0;
}

.fb-toggle input {
    appearance: none;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    margin: 0;
    cursor: pointer;
    transition: background 0.18s ease;
}

.fb-toggle input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.fb-toggle input:checked { background: #3b82f6; }
.fb-toggle input:checked::after { transform: translateX(0.95rem); }

@media (max-width: 1280px) {
    .fb-post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .fb-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .fb-post-grid { grid-template-columns: 1fr; }
    .fb-toolbar { padding: 0.8rem; }

    .fb-toolbar-top {
        gap: 0.65rem;
    }

    .fb-toolbar-actions {
        width: 100%;
        margin-inline-start: 0;
    }

    .fb-bulk-btn {
        flex: 1;
    }
}

/* -------- Facebook post setup -------- */
.ps-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 5.5rem;
}

.ps-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ps-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ps-back:hover {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
    color: var(--primary);
    text-decoration: none;
}

.ps-tabs {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.ps-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.ps-tab.is-active {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.ps-select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.14), var(--surface-muted) 45%),
        var(--surface);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 24px rgba(2, 6, 23, 0.16);
}

.ps-select-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.ps-select-mark {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(96, 165, 250, 0.28);
}

.ps-select-mark .ico {
    width: 15px;
    height: 15px;
}

.ps-select-copy {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.ps-select-kicker {
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.ps-select-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(58vw, 28rem);
}

.ps-select-id {
    width: fit-content;
    max-width: 100%;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-select-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.ps-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.ps-select-btn:hover {
    background: rgba(37, 99, 235, 0.32);
    border-color: rgba(96, 165, 250, 0.55);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.ps-select-btn-ghost {
    border-color: var(--border);
    background: var(--surface-muted);
    color: var(--muted);
}

.ps-select-btn-ghost:hover {
    border-color: var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 700px) {
    .ps-select-bar {
        padding: 0.8rem;
        gap: 0.75rem;
    }

    .ps-select-title {
        max-width: 70vw;
        font-size: 0.9rem;
    }

    .ps-select-actions {
        width: 100%;
    }

    .ps-select-btn {
        flex: 1;
        justify-content: center;
    }
}

.ps-hero {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(145deg, var(--surface-muted), var(--surface));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 14px 32px rgba(2, 6, 23, 0.2);
}

.ps-hero-media {
    position: relative;
    min-height: 100%;
    align-self: stretch;
    background: transparent;
    overflow: hidden;
}

.ps-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ps-hero-media.is-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    background: var(--surface-muted);
    color: #64748b;
}

.ps-hero-media-fallback .ico {
    width: 28px;
    height: 28px;
    opacity: 0.7;
}

.ps-hero-body {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.15rem 1.25rem 1.2rem;
    min-width: 0;
}

.ps-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ps-hero-page {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ps-hero-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #1e293b;
    flex-shrink: 0;
}

.ps-hero-page strong {
    display: block;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ps-hero-page span {
    display: block;
    margin-top: 0.1rem;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ps-hero-platform {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: #1877f2;
    color: #fff;
}

.ps-hero-platform .ico {
    width: 16px;
    height: 16px;
}

.ps-hero-title {
    margin: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.35;
}

.ps-hero-id {
    width: fit-content;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.ps-hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ps-hero-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.ps-hero-toggle-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.ps-hero-toggle-copy strong {
    color: var(--text);
    font-size: 0.86rem;
}

.ps-hero-toggle-copy small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 550;
}

.ps-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .ps-hero {
        grid-template-columns: 1fr;
    }

    .ps-hero-media {
        position: relative;
        min-height: 0;
        aspect-ratio: 16 / 10;
        max-height: 280px;
    }
}

.ps-card {
    padding: 1.1rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
}

.ps-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.ps-card-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.ps-card-title h2 {
    margin: 0;
    font-size: 1.1rem;
}

.ps-switch-line {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
}

.ps-toggle-ui {
    width: 2.5rem;
    height: 1.3rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.18s ease;
}

.ps-toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.ps-preview-toggle input,
.ps-hero-toggle input,
.ps-switch-line input,
.ps-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-preview-toggle input:checked + .ps-toggle-ui,
.ps-hero-toggle input:checked + .ps-toggle-ui,
.ps-switch-line input:checked + .ps-toggle-ui,
.ps-option input:checked + .ps-toggle-ui {
    background: #3b82f6;
}

.ps-preview-toggle input:checked + .ps-toggle-ui::after,
.ps-hero-toggle input:checked + .ps-toggle-ui::after,
.ps-switch-line input:checked + .ps-toggle-ui::after,
.ps-option input:checked + .ps-toggle-ui::after {
    transform: translateX(1.15rem);
}

.ps-composer textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    color: var(--text);
    padding: 0.9rem 1rem;
    font: inherit;
}

.ps-composer-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.ps-options {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
}

.ps-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    font-weight: 650;
    cursor: pointer;
}

.ps-option span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.ps-option.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ps-toggle-ui.is-locked {
    background: rgba(148, 163, 184, 0.18);
}

.ps-media-panel {
    margin-top: 0.35rem;
    padding: 0.9rem 0.95rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.05);
}

.ps-media-hint {
    margin: 0 0 0.75rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.ps-media-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.ps-media-pick {
    cursor: pointer;
}

.ps-media-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 650;
    color: #f87171;
    cursor: pointer;
}

.ps-media-remove-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ps-media-remove-btn:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.55);
    transform: translateY(-1px);
}

.ps-media-remove-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

html[data-theme="light"] .ps-media-remove-btn {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.ps-media-preview {
    margin-top: 0.85rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.ps-media-preview.has-file {
    justify-content: flex-start;
}

.ps-media-preview img,
.ps-media-preview video,
.ps-media-preview audio {
    max-width: min(100%, 320px);
    max-height: 220px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.35);
    object-fit: cover;
}

.ps-media-preview audio {
    width: min(100%, 320px);
    max-height: none;
    padding: 0.55rem;
}

.ps-messenger-logo {
    display: inline-flex;
    width: 1.55rem;
    height: 1.55rem;
    align-items: center;
    justify-content: center;
    color: #0084ff;
}

.ps-messenger-logo .ico {
    width: 1.35rem;
    height: 1.35rem;
}

.ps-dm-combine-hint {
    margin: 0 0 0.65rem;
    font-size: 0.84rem;
    line-height: 1.4;
}

.ps-dm-types {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0.15rem 0 1rem;
    padding: 0.35rem;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.28);
}

html[data-theme="light"] .ps-dm-types {
    background: #f1f5f9;
}

.ps-dm-type {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 0.78rem 0.9rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ps-dm-type input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ps-dm-type-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    color: inherit;
    flex: 0 0 auto;
}

.ps-dm-type-ico .ico {
    width: 1.2rem;
    height: 1.2rem;
}

.ps-dm-type-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.ps-dm-type-check {
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    color: #7dd3fc;
    flex: 0 0 auto;
}

.ps-dm-type-check .ico {
    width: 1rem;
    height: 1rem;
    stroke-width: 2.4;
}

.ps-dm-type:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

.ps-dm-type.is-active {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
}

.ps-dm-type.is-active .ps-dm-type-check {
    display: inline-flex;
}

html[data-theme="light"] .ps-dm-type {
    color: #64748b;
}

html[data-theme="light"] .ps-dm-type:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
}

html[data-theme="light"] .ps-dm-type.is-active {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

html[data-theme="light"] .ps-dm-type.is-active .ps-dm-type-check {
    color: #2563eb;
}

.ps-dm-pane {
    margin-bottom: 0.35rem;
}

.ps-voice-recorder {
    margin: 0 0 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(248, 113, 113, 0.22);
    background:
        radial-gradient(360px 120px at 0% 0%, rgba(248, 113, 113, 0.12), transparent 65%),
        rgba(148, 163, 184, 0.05);
}

html[data-theme="light"] .ps-voice-recorder {
    background:
        radial-gradient(360px 120px at 0% 0%, rgba(239, 68, 68, 0.08), transparent 65%),
        #fff;
    border-color: #fecaca;
}

.ps-voice-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.ps-voice-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1.05rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-weight: 750;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.ps-voice-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.ps-voice-btn.is-recording {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.ps-voice-btn-ico {
    display: inline-flex;
    width: 1.15rem;
    height: 1.15rem;
}

.ps-voice-btn-ico .ico {
    width: 100%;
    height: 100%;
}

.ps-voice-meta {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.ps-voice-timer {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.ps-voice-status {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--muted);
}

.ps-voice-wave {
    display: none;
    align-items: end;
    gap: 0.28rem;
    height: 1.6rem;
    margin-top: 0.85rem;
}

.ps-voice-recorder.is-live .ps-voice-wave {
    display: flex;
}

.ps-voice-wave span {
    width: 0.28rem;
    border-radius: 999px;
    background: #f87171;
    animation: psVoicePulse 0.9s ease-in-out infinite;
}

.ps-voice-wave span:nth-child(1) { height: 35%; animation-delay: 0s; }
.ps-voice-wave span:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.ps-voice-wave span:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.ps-voice-wave span:nth-child(4) { height: 90%; animation-delay: 0.05s; }
.ps-voice-wave span:nth-child(5) { height: 55%; animation-delay: 0.15s; }
.ps-voice-wave span:nth-child(6) { height: 75%; animation-delay: 0.25s; }
.ps-voice-wave span:nth-child(7) { height: 40%; animation-delay: 0.12s; }

@keyframes psVoicePulse {
    0%, 100% { transform: scaleY(0.55); opacity: 0.65; }
    50% { transform: scaleY(1); opacity: 1; }
}

.ps-voice-note {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .ps-dm-type {
        padding: 0.72rem 0.8rem;
    }
}

.ps-example {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.ps-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.65rem;
}

.ps-thread-item {
    display: flex;
    gap: 0.65rem;
}

.ps-thread-item.is-reply {
    margin-left: 2rem;
}

.ps-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #334155;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 750;
    flex-shrink: 0;
}

.ps-avatar-brand {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.ps-bubble {
    display: inline-block;
    padding: 0.55rem 0.75rem;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.16);
    color: #e2e8f0;
    font-size: 0.9rem;
}

.ps-bubble strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}

.ps-thread-item small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.ps-delay {
    margin-top: 1rem;
    padding: 1rem 1.05rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(0, 132, 255, 0.1), transparent 65%),
        rgba(148, 163, 184, 0.05);
}

html[data-theme="light"] .ps-delay {
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(37, 99, 235, 0.08), transparent 65%),
        #f8fafc;
    border-color: #e2e8f0;
}

.ps-delay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.ps-delay-title {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.ps-delay-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 12px;
    color: #38bdf8;
    background: rgba(0, 132, 255, 0.12);
    border: 1px solid rgba(0, 132, 255, 0.18);
    flex: 0 0 auto;
}

html[data-theme="light"] .ps-delay-ico {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ps-delay-title label {
    display: block;
    margin: 0;
    font-weight: 750;
    font-size: 0.95rem;
    color: var(--text);
}

.ps-delay-sub {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--muted);
}

.ps-delay-value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 132, 255, 0.12);
    border: 1px solid rgba(0, 132, 255, 0.22);
    color: #7dd3fc;
    flex: 0 0 auto;
}

html[data-theme="light"] .ps-delay-value {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.ps-delay-value strong {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.ps-delay-value span {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
    text-transform: lowercase;
}

.ps-delay-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.ps-delay-chip {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.28);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

html[data-theme="light"] .ps-delay-chip {
    background: #fff;
    border-color: #e2e8f0;
    color: #64748b;
}

.ps-delay-chip:hover {
    border-color: rgba(0, 132, 255, 0.4);
    color: #e2e8f0;
    transform: translateY(-1px);
}

html[data-theme="light"] .ps-delay-chip:hover {
    color: #0f172a;
}

.ps-delay-chip.is-active {
    background: rgba(0, 132, 255, 0.18);
    border-color: rgba(0, 132, 255, 0.45);
    color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

html[data-theme="light"] .ps-delay-chip.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ps-delay-slider {
    display: grid;
    gap: 0.35rem;
}

.ps-delay input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.55rem;
    border-radius: 999px;
    background:
        linear-gradient(#0084ff, #0084ff) 0 / var(--delay-pct, 10%) 100% no-repeat,
        rgba(148, 163, 184, 0.22);
    outline: none;
    cursor: pointer;
}

html[data-theme="light"] .ps-delay input[type="range"] {
    background:
        linear-gradient(#2563eb, #2563eb) 0 / var(--delay-pct, 10%) 100% no-repeat,
        #e2e8f0;
}

.ps-delay input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #0084ff;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.28);
    cursor: pointer;
    transition: transform 0.12s ease;
}

html[data-theme="light"] .ps-delay input[type="range"]::-webkit-slider-thumb {
    border-color: #2563eb;
}

.ps-delay input[type="range"]::-moz-range-thumb {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #0084ff;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.28);
    cursor: pointer;
}

.ps-delay input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.08);
}

.ps-delay-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--muted);
    padding: 0 0.1rem;
}

.ps-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.5rem -0.25rem 0;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface);
    backdrop-filter: blur(12px);
}

.ps-footer-actions {
    display: flex;
    gap: 0.55rem;
}

@media (max-width: 700px) {
    .ps-thread-item.is-reply { margin-left: 1rem; }
}

img.ps-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    background: #334155;
    flex-shrink: 0;
    display: block;
}

img.ps-avatar-brand {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

/* -------- Post analytics -------- */
.pa-shell {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding-bottom: 0.5rem;
}

.pa-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pa-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pa-back:hover {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 40%, transparent);
    color: var(--primary);
    text-decoration: none;
}

.pa-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.pa-range {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface-muted);
}

.pa-range a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pa-range a:hover { color: #e2e8f0; }

.pa-range a.is-active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.pa-setup-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(37, 99, 235, 0.18);
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.pa-setup-btn:hover {
    background: rgba(37, 99, 235, 0.32);
    color: #fff;
    text-decoration: none;
}

.pa-hero {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 0.85rem;
    padding: 0.7rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(37, 99, 235, 0.2), transparent 55%),
        linear-gradient(180deg, var(--surface), var(--surface));
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.2);
}

.pa-hero-media {
    position: relative;
    aspect-ratio: 1;
    width: 118px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.pa-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pa-hero-media.is-empty {
    display: grid;
    place-items: center;
    background:
        radial-gradient(120px 90px at 50% 40%, rgba(59, 130, 246, 0.2), transparent 70%),
        var(--surface-muted);
}

.pa-hero-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--surface-muted);
    pointer-events: auto;
}

.pa-hero-actions .fb-post-action {
    width: 1.85rem;
    height: 1.85rem;
}

.pa-hero-actions .fb-post-action .ico {
    width: 12px;
    height: 12px;
}

.pa-hero-fallback {
    color: #64748b;
}

.pa-hero-fallback .ico {
    width: 26px;
    height: 26px;
}

.pa-hero-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.pa-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.pa-hero-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--surface-muted);
}

.pa-kicker {
    margin: 0;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pa-hero-meta strong {
    display: block;
    margin-top: 0.05rem;
    font-size: 0.9rem;
    color: var(--text);
}

.pa-hero-title {
    margin: 0;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text);
}

.pa-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pa-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.pa-tag-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--muted);
}

.pa-tag-range {
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
}

.pa-card {
    padding: 0.85rem 0.9rem 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
}

.pa-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.pa-card-head h2 {
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.pa-card-head .muted {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
}

.pa-chart-badge {
    flex-shrink: 0;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
}

.pa-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.pa-metric {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 56px;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(160deg, rgba(37, 99, 235, 0.08), transparent 55%),
        var(--surface);
}

.pa-metric small {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
}

.pa-metric strong {
    display: block;
    margin-top: 0.08rem;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.pa-metric-hint {
    display: block;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.35;
}

.pa-metric-ico {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--primary);
}

.pa-metric-ico .ico {
    width: 15px;
    height: 15px;
}

.pa-metric.is-likes .pa-metric-ico,
.pa-metric.is-messages .pa-metric-ico,
.pa-metric.is-replies .pa-metric-ico,
.pa-metric.is-rate .pa-metric-ico {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.pa-metric.is-warn .pa-metric-ico {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.pa-metric.is-requests {
    border-color: rgba(96, 165, 250, 0.22);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), transparent 55%),
        var(--surface);
}

.pa-metric-wide {
    margin-top: 0.5rem;
    justify-content: flex-start;
}

.pa-metric-wide strong {
    margin-left: auto;
    margin-top: 0;
    font-size: 1.2rem;
}

.pa-ok {
    margin: 1rem 0 0;
    color: #34d399;
    font-weight: 700;
}

.pa-fail-list {
    margin: 0.9rem 0 0;
    padding-left: 1.1rem;
    color: #fca5a5;
}

.pa-fail-list li + li { margin-top: 0.35rem; }

.pa-card .chart-svg-box {
    margin-top: 0.65rem;
    padding: 0.65rem 0.55rem 0.4rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--surface-muted);
}

.pa-card .activity-chart {
    width: 100%;
    min-height: 120px;
}

@media (max-width: 900px) {
    .pa-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pa-hero {
        grid-template-columns: 108px minmax(0, 1fr);
    }

    .pa-hero-media {
        width: 108px;
    }
}

@media (max-width: 700px) {
    .pa-topbar-actions {
        width: 100%;
    }

    .pa-range {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pa-range::-webkit-scrollbar { display: none; }

    .pa-setup-btn {
        flex-shrink: 0;
    }

    .pa-hero {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .pa-hero-media {
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: 140px;
    }

    .pa-hero-title {
        font-size: 1.05rem;
    }

    .pa-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .pa-metric {
        flex-direction: row;
        align-items: center;
        gap: 0.55rem;
        min-height: 54px;
        padding: 0.55rem 0.6rem;
    }

    .pa-metric > div {
        min-width: 0;
        flex: 1;
    }

    .pa-metric small {
        font-size: 0.66rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pa-metric strong {
        font-size: 1.05rem;
    }

    .pa-metric-ico {
        width: 1.85rem;
        height: 1.85rem;
        border-radius: 9px;
    }

    .pa-metric-ico .ico {
        width: 14px;
        height: 14px;
    }

    .pa-metric-wide {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        min-height: 54px;
    }

    .pa-metric-wide .pa-metric-hint {
        display: none;
    }

    .pa-metric-wide strong {
        width: auto;
        margin-left: auto;
        margin-top: 0;
        padding-left: 0;
        font-size: 1.15rem;
    }
}

@media (max-width: 420px) {
    .pa-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pa-card { padding: 0.75rem; }
}

/* ===== Spacing tighten (v32) ===== */
.main-content > :last-child {
    margin-bottom: 0;
}

.main-content .card-narrow:last-child {
    margin-bottom: 0 !important;
}

.locale-ku,
.locale-ar,
html[dir="rtl"] body {
    letter-spacing: 0;
}

.locale-ku h1,
.locale-ar h1,
.locale-ku h2,
.locale-ar h2,
.locale-ku .btn,
.locale-ar .btn,
.locale-ku .nav-link,
.locale-ar .nav-link {
    letter-spacing: 0;
}

.history-empty-line {
    margin: 0.65rem 0 0;
}

.history-layout,
.history-split,
.insights-grid,
.dash-layout {
    gap: 0.85rem;
}

.history-filters {
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.history-filters-modern .history-select {
    border-radius: 12px;
    background: var(--surface-muted);
}

html[dir="rtl"] .history-date-sep {
    display: inline-block;
    transform: scaleX(-1);
}

.coverage-card,
.history-main .card {
    min-height: 0;
}

.page-header h1 {
    letter-spacing: -0.045em;
}

.icon-btn {
    border-radius: 999px;
}

.alert {
    border-radius: 14px;
    animation: contentRise 0.4s var(--ease-out) both;
}

.sidebar-brand a {
    border-radius: 16px;
    padding: 0.35rem 0.4rem;
    transition: background 0.2s var(--ease);
}

.sidebar-brand a:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chart-svg-box {
    border-radius: 16px;
    border: 1px solid var(--border);
    background:
        linear-gradient(180deg, var(--primary-soft), transparent 42%),
        var(--surface-muted);
    padding: 0.85rem 0.75rem 0.45rem;
}

.activity-chart {
    width: 100%;
    height: auto;
    display: block;
}

.activity-chart .chart-dot {
    fill: var(--surface);
    stroke: var(--chart-line-soft);
    stroke-width: 2;
}

.legend-item {
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.legend-item:hover {
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
}

.metric-card-static {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-height: 0;
}

.metric-card-static .metric-value {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .dash-hero,
    .dash-welcome {
        padding: 1.15rem 1.1rem;
        border-radius: 20px;
    }

    .metric-grid { grid-template-columns: 1fr; }

    .menu-toggle { display: grid; }
}

html[dir="rtl"] .nav-link:hover,
html[dir="rtl"] .quick-link:hover {
    transform: translateX(-3px);
}


.settings-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1.2rem 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(520px 180px at 100% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
    animation: contentRise 0.45s var(--ease-out) both;
}

.settings-hero-identity {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.03em;
    color: #fff;
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.14),
        0 12px 24px rgba(37, 99, 235, 0.28);
}

.settings-hero h1 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    letter-spacing: -0.045em;
}

.settings-hero .muted {
    margin: 0;
    max-width: 46ch;
}

.settings-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.settings-meta-chip {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.03);
    min-width: 0;
}

.settings-meta-chip .muted {
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.settings-meta-chip strong {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-break: break-all;
}

.settings-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
    max-width: 980px;
}

.settings-panel {
    padding: 1.2rem 1.25rem;
}

.settings-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

.settings-panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.025em;
}

.settings-panel-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.06);
}

.settings-panel-ico .ico {
    width: 18px;
    height: 18px;
}

.settings-panel-ico-warn {
    background: rgba(251, 113, 133, 0.12);
    color: #fda4af;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.06);
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.settings-panel-profile,
.settings-panel-security {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background:
        radial-gradient(420px 160px at 100% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
        var(--surface);
}

.settings-profile-form,
.settings-security-form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.settings-profile-form .settings-actions,
.settings-security-form .settings-actions {
    margin-top: auto;
}

.settings-profile-form .settings-actions .btn,
.settings-panel-profile .settings-actions .btn {
    width: 100%;
}

.settings-panel-ico-secure {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.06);
}

.settings-security-form .form-group {
    margin-bottom: 0.85rem;
}

.settings-field-block {
    margin-bottom: 1.05rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.settings-field-block + .settings-field-block {
    margin-top: 0.15rem;
}

.settings-field-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
}

.settings-field-label span {
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    color: #e8eef8;
}

.settings-field-label small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.settings-security-tips {
    list-style: none;
    margin: 0.15rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.settings-security-tips li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #9eafc7;
    font-size: 0.78rem;
    font-weight: 550;
}

.settings-security-tips .ico {
    width: 13px;
    height: 13px;
    color: #34d399;
    flex-shrink: 0;
}

.settings-panel-security .settings-actions {
    margin-top: 0.15rem;
}

.settings-panel-security .settings-actions .btn {
    width: 100%;
}

.settings-session {
    grid-column: 1 / -1;
}

.settings-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.settings-session-row strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.settings-session-row .muted {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .settings-hero {
        padding: 1rem;
    }

    .settings-hero-identity {
        align-items: flex-start;
    }

    .settings-layout .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* -------- App FAQ page -------- */
.faq-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.95rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(420px 140px at 100% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
    animation: contentRise 0.45s var(--ease-out) both;
}

.faq-hero-compact {
    margin-bottom: 0.7rem;
}

.faq-hero h1 {
    margin: 0 0 0.2rem;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    letter-spacing: -0.045em;
}

.faq-hero .muted {
    margin: 0;
    max-width: 46ch;
    font-size: 0.9rem;
}

.faq-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.faq-layout {
    display: block;
    max-width: 820px;
}

.faq-panel {
    padding: 0.85rem;
    max-width: 820px;
}

.faq-panel-compact {
    margin: 0;
}

.faq-panel-head {
    display: none;
}

.faq-list-app {
    gap: 0.45rem;
}

.faq-item-app {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.faq-item-app:hover,
.faq-item-app[open] {
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.05);
}

.faq-item-app summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.faq-item-app summary::after {
    content: none;
    float: none;
}

.faq-item-index {
    display: grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.35rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.faq-item-q {
    min-width: 0;
    line-height: 1.35;
}

.faq-item-toggle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    flex-shrink: 0;
}

.faq-item-toggle::before,
.faq-item-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1.5px;
    border-radius: 2px;
    background: #93c5fd;
    transform: translate(-50%, -50%);
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.faq-item-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item-app[open] .faq-item-toggle::after {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
}

.faq-item-body {
    padding: 0 0.9rem 0.85rem 3.35rem;
}

.faq-item-app p {
    margin: 0;
    color: #9eafc7;
    font-size: 0.9rem;
    line-height: 1.55;
}

.faq-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
    max-width: 820px;
}

.faq-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.faq-quick-link:hover {
    color: #fff;
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.faq-side,
.faq-side-card {
    display: none;
}

@media (max-width: 640px) {
    .faq-item-body {
        padding-left: 0.9rem;
    }

    .faq-hero {
        padding: 0.85rem;
    }
}

/* -------- App Tutorial page -------- */
.tutorial-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.95rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(420px 140px at 100% 0%, rgba(59, 130, 246, 0.14), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
    animation: contentRise 0.45s var(--ease-out) both;
}

.tutorial-hero h1 {
    margin: 0 0 0.2rem;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    letter-spacing: -0.045em;
}

.tutorial-hero .muted {
    margin: 0;
    max-width: 48ch;
    font-size: 0.9rem;
}

.tutorial-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tutorial-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    max-width: 980px;
    margin-bottom: 0.7rem;
}

.tutorial-step {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.05rem;
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}

.tutorial-step:hover {
    border-color: rgba(96, 165, 250, 0.32);
    transform: translateY(-2px);
}

.tutorial-step.is-done {
    border-color: rgba(52, 211, 153, 0.28);
    background:
        radial-gradient(280px 120px at 100% 0%, rgba(52, 211, 153, 0.1), transparent 55%),
        var(--surface);
}

.tutorial-step-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tutorial-step-num {
    display: grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.tutorial-step-ico {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
    color: #93c5fd;
}

.tutorial-step-ico .ico {
    width: 15px;
    height: 15px;
}

.tutorial-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.22);
    color: #6ee7b7;
    font-size: 0.68rem;
    font-weight: 750;
}

.tutorial-step-badge .ico {
    width: 12px;
    height: 12px;
}

.tutorial-step h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.tutorial-step .muted {
    margin: 0;
    flex: 1;
    font-size: 0.86rem;
    line-height: 1.5;
}

.tutorial-step .btn {
    align-self: flex-start;
    margin-top: 0.35rem;
}

.tutorial-note {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    max-width: 980px;
    padding: 0.95rem 1.05rem;
}

.tutorial-note h2 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.tutorial-note .muted {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.tutorial-note-ico {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.tutorial-note-ico .ico {
    width: 16px;
    height: 16px;
}

@media (max-width: 960px) {
    .tutorial-steps {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .tutorial-note {
        max-width: none;
    }
}

.admin-review-photo {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.admin-review-photo-preview {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--surface-muted);
    flex-shrink: 0;
}

.admin-review-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-review-photo-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.admin-review-photo-controls input[type="file"] {
    max-width: 100%;
    font-size: 0.84rem;
}

.admin-review-photo-remove {
    margin: 0.15rem 0 0;
}

.admin-review-author-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.admin-review-thumb {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-review-thumb-fallback {
    display: grid;
    place-items: center;
    font-size: 0.68rem;
    font-weight: 750;
    color: #ecfdf5;
    background: linear-gradient(145deg, rgba(45, 212, 191, 0.35), rgba(15, 118, 110, 0.55));
}

/* -------- Referrals -------- */
.ref-shell {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
}

.ref-hero {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(52, 211, 153, 0.2);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(16, 185, 129, 0.18), transparent 55%),
        linear-gradient(180deg, var(--surface), var(--surface));
}

.ref-hero h1 {
    margin: 0 0 0.3rem;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    letter-spacing: -0.02em;
}

.ref-hero .muted { margin: 0; max-width: 52ch; }

.ref-card {
    padding: 1rem 1.05rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
}

.ref-card-head h2,
.ref-share-copy h2 {
    margin: 0;
    font-size: 1.02rem;
}

.ref-card-head .muted,
.ref-share-copy .muted {
    margin: 0.25rem 0 0;
    font-size: 0.84rem;
}

.ref-share {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ref-share-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.ref-code {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, 0.32);
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 0.82rem;
    line-height: 1;
}

.ref-link-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.4rem 0.35rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: var(--surface);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.ref-link-bar:focus-within {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.ref-link-ico {
    display: inline-flex;
    color: #6ee7b7;
    flex-shrink: 0;
    opacity: 0.9;
}

.ref-link-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.35;
    padding: 0.55rem 0.15rem;
    outline: none;
    box-shadow: none;
    color-scheme: inherit;
}

.ref-link-bar .btn {
    flex-shrink: 0;
    border-radius: 10px;
    min-height: 2.35rem;
    padding-inline: 0.95rem;
}

.ref-link-bar .btn.is-copied {
    background: rgba(16, 185, 129, 0.9);
    border-color: transparent;
}

.ref-copy-ok {
    margin: 0;
    color: #6ee7b7;
    font-weight: 700;
    font-size: 0.84rem;
}

.ref-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.ref-stat {
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
}

.ref-stat small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.ref-stat strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.ref-stat.is-pending strong { color: #d97706; }
.ref-stat.is-paid strong { color: var(--success); }
.ref-stat.is-total strong { color: var(--primary); }

html:not([data-theme="light"]) .ref-stat.is-pending strong { color: #fde68a; }
html:not([data-theme="light"]) .ref-stat.is-paid strong { color: #6ee7b7; }
html:not([data-theme="light"]) .ref-stat.is-total strong { color: #93c5fd; }

.ref-table-wrap { overflow-x: auto; margin-top: 0.85rem; }

.ref-table td strong { display: block; }
.ref-table td small { display: block; margin-top: 0.15rem; }

.ref-status {
    display: inline-flex;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
}

.ref-status.is-pending {
    background: rgba(250, 204, 21, 0.14);
    border: 1px solid rgba(250, 204, 21, 0.3);
    color: #fde68a;
}

.ref-status.is-paid {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #6ee7b7;
}

.admin-ref-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.admin-ref-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.admin-ref-main {
    padding: 1.15rem 1.2rem 1.25rem;
}

.admin-ref-panel-head h2 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}

.admin-ref-panel-head .panel-sub {
    margin: 0.3rem 0 0;
}

.admin-ref-form { margin-top: 1rem; }

.admin-ref-field { margin-bottom: 1.05rem; }

.admin-ref-field-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.85rem;
    margin-bottom: 0.55rem;
}

.admin-ref-field-label > span {
    font-weight: 700;
    font-size: 0.9rem;
}

.admin-ref-picker {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--surface);
    overflow: hidden;
}

.admin-ref-picker-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.admin-ref-picker-ico {
    display: inline-flex;
    color: #94a3b8;
    flex-shrink: 0;
}

.admin-ref-picker-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    padding: 0.2rem 0;
    outline: none;
    box-shadow: none;
}

.admin-ref-picker-list {
    max-height: 16.5rem;
    overflow: auto;
    display: grid;
    gap: 0;
}

.admin-ref-buyer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease;
}

.admin-ref-buyer:last-child { border-bottom: 0; }

.admin-ref-buyer:hover {
    background: rgba(96, 165, 250, 0.08);
}

.admin-ref-buyer.is-selected {
    background: rgba(16, 185, 129, 0.12);
    box-shadow: inset 3px 0 0 #34d399;
}

.admin-ref-buyer-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #dbeafe;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.45), var(--surface));
    border: 1px solid rgba(147, 197, 253, 0.25);
}

.admin-ref-buyer-copy {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
}

.admin-ref-buyer-copy strong {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-ref-buyer-copy small {
    color: #94a3b8;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-ref-buyer-badge {
    flex-shrink: 0;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.28);
}

.admin-ref-buyer-badge.is-muted {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.16);
}

.admin-ref-picker-empty {
    margin: 0;
    padding: 1.1rem 0.95rem;
    text-align: center;
    font-size: 0.86rem;
}

.admin-ref-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.admin-ref-fields .admin-ref-notes {
    grid-column: 1 / -1;
}

.admin-ref-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-ref-summary {
    padding: 1.1rem 1.15rem;
    border-color: rgba(52, 211, 153, 0.28);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(16, 185, 129, 0.16), transparent 55%),
        var(--surface);
}

.admin-ref-summary-kicker {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6ee7b7;
}

.admin-ref-summary-cash {
    margin-bottom: 0.95rem;
}

.admin-ref-summary-cash small {
    display: block;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 650;
}

.admin-ref-summary-cash strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.85rem;
    letter-spacing: -0.03em;
    color: #a7f3d0;
    line-height: 1.1;
}

.admin-ref-summary-rows {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-ref-summary-row {
    display: grid;
    gap: 0.15rem;
}

.admin-ref-summary-row span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-ref-summary-row strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.admin-ref-summary-warn {
    margin: 0.75rem 0 0;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(250, 204, 21, 0.1);
    color: #fde68a;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.4;
}

.admin-ref-summary-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.admin-ref-side h2 {
    margin: 0;
    font-size: 1rem;
}

.admin-ref-side .panel-sub {
    margin: 0.3rem 0 0.85rem;
}

.admin-ref-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
    counter-reset: refstep;
}

.admin-ref-steps li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.15rem 0.7rem;
    align-items: start;
    counter-increment: refstep;
}

.admin-ref-steps li::before {
    content: counter(refstep);
    grid-row: 1 / span 2;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.28);
}

.admin-ref-steps strong {
    font-size: 0.86rem;
    color: var(--text);
}

.admin-ref-steps span {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.admin-ref-list { margin-top: 1rem; }

.admin-ref-person {
    display: grid;
    gap: 0.1rem;
}

.admin-ref-person small {
    display: block;
    font-size: 0.78rem;
}

@media (max-width: 980px) {
    .admin-ref-layout { grid-template-columns: 1fr; }
    .admin-ref-stats { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .admin-ref-fields { grid-template-columns: 1fr; }
    .admin-ref-buyer-badge { display: none; }
}

.billing-referral-note {
    margin: 0.85rem 0 0;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.25);
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    font-size: 0.86rem;
    font-weight: 650;
}

.billing-referral-note a {
    color: #6ee7b7;
    font-weight: 750;
}

@media (max-width: 900px) {
    .ref-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .ref-stats { grid-template-columns: 1fr; }
    .ref-share-top { flex-direction: column; align-items: stretch; }
    .ref-code { align-self: flex-start; }
    .ref-link-bar {
        flex-wrap: wrap;
        padding: 0.55rem;
    }
    .ref-link-input { width: 100%; flex: 1 1 100%; padding-inline: 0.35rem; }
    .ref-link-bar .btn { width: 100%; }
}

/* -------- Quick replies -------- */
.qr-page {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    max-width: none;
}

.qr-hero {
    padding: 1rem 1.15rem;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(480px 160px at 100% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow);
}

.qr-hero-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.qr-hero-identity {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: min(100%, 280px);
    flex: 1 1 320px;
}

.qr-hero-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 8%, transparent);
}

.qr-hero-copy {
    min-width: 0;
}

.qr-hero-copy h1 {
    margin: 0.1rem 0 0.35rem;
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    letter-spacing: -0.04em;
}

.qr-hero-copy .muted {
    margin: 0;
    max-width: 62ch;
    font-size: 0.9rem;
    line-height: 1.45;
}

.qr-tabs {
    display: inline-flex;
    gap: 0.4rem;
    padding: 0.28rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: var(--surface);
    flex-shrink: 0;
}

.qr-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 11px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
}

.qr-tab:hover {
    color: var(--text);
    background: var(--surface-muted);
    text-decoration: none;
}

.qr-tab.is-active {
    background: #1877f2;
    color: #fff;
}

.qr-tab[href*="instagram"].is-active {
    background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.qr-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 0.9rem;
    align-items: start;
    width: 100%;
}

.qr-panel {
    min-width: 0;
}

.qr-enable {
    margin: 0 0 1.1rem;
    display: inline-flex;
    max-width: 100%;
}

.qr-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.qr-button-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.qr-button-fields {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
    gap: 0.65rem;
    flex: 1 1 auto;
    min-width: 0;
}

.qr-button-row .form-group {
    margin: 0;
}

.qr-button-row input {
    width: 100%;
    min-width: 0;
}

.qr-remove {
    flex-shrink: 0;
    margin-top: 1.55rem;
    min-width: 42px;
    min-height: 42px;
    padding: 0.55rem;
}

.qr-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
}

.qr-actions .btn {
    min-height: 44px;
}

@media (max-width: 1100px) {
    .qr-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .qr-hero {
        padding: 0.9rem;
    }

    .qr-hero-main {
        flex-direction: column;
        align-items: stretch;
    }

    .qr-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .qr-tab {
        width: 100%;
    }

    .qr-button-fields {
        grid-template-columns: 1fr;
    }

    .qr-button-row {
        flex-direction: column;
        padding: 0.75rem;
    }

    .qr-remove {
        margin-top: 0;
        align-self: flex-end;
    }

    .qr-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .qr-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .qr-hero-identity {
        gap: 0.7rem;
    }

    .qr-hero-ico {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .qr-hero-copy .muted {
        font-size: 0.84rem;
    }

    .qr-panel.settings-panel {
        padding: 1rem 0.9rem;
    }
}

.admin-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.1rem;
    margin-top: 1.15rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}

.admin-pager-meta {
    margin: 0;
    font-size: 0.84rem;
}

.admin-pager-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.admin-pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: #e8eefc;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-pager-btn:hover {
    background: rgba(45, 212, 191, 0.1);
    border-color: rgba(45, 212, 191, 0.35);
    color: #fff;
}

.admin-pager-btn.is-disabled {
    opacity: 0.38;
    pointer-events: none;
}

.admin-pager-ico-next {
    transform: scaleX(-1);
}

[dir="rtl"] .admin-pager-ico-next {
    transform: none;
}

[dir="rtl"] .admin-pager-btn .ico:not(.admin-pager-ico-next) {
    transform: scaleX(-1);
}

.admin-pager-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.45rem;
    border-radius: 9px;
    border: 1px solid transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-pager-num:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
}

.admin-pager-num.is-current {
    color: #042f2e;
    background: linear-gradient(180deg, #5eead4, #2dd4bf);
    border-color: transparent;
    font-weight: 600;
}

.admin-pager-ellipsis {
    min-width: 1.2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    user-select: none;
}

@media (max-width: 640px) {
    .admin-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-pager-controls {
        justify-content: space-between;
    }

    .admin-pager-pages {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.15rem;
    }
}

/* -------- Theme toggle -------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 0.18s var(--ease-out);
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    background: var(--surface-muted);
    color: var(--primary);
    transform: translateY(-1px);
}

.theme-toggle-ico {
    display: none;
    line-height: 0;
}

html[data-theme="light"] .theme-toggle-moon { display: grid; }
html:not([data-theme]) .theme-toggle-sun,
html[data-theme="dark"] .theme-toggle-sun { display: grid; }

.theme-toggle .ico {
    width: 1rem;
    height: 1rem;
}

/* =========================================================
   Theme polish — keep light truly light, dark truly dark
   ========================================================= */

/* Content text that used near-white greys → theme tokens */
.fb-hero h1,
.fb-post-title,
.fb-quota-value,
.admin-top-page,
.admin-top-user-name,
.ps-head h1,
.qr-head h1,
.insights-hero h1,
.billing-card-top h2,
.history-title,
.ref-card h2,
.ao-empty h2,
.dash-panel h2,
.card > h2,
.card > h1 {
    color: var(--text);
}

.fb-hero-kicker,
.fb-quota-kicker,
.admin-top-kicker,
.section-kicker {
    color: var(--primary);
}

.fb-hero-btn-ghost,
.admin-settings-menu-link:hover,
.insights-range-tab,
.fb-post-meta,
.fb-toolbar .muted,
.ps-tab,
.qr-tab {
    color: var(--muted);
}

.fb-hero-btn-ghost:hover,
.admin-settings-menu-link.is-active,
.ps-tab.is-active,
.qr-tab.is-active,
.insights-range-tab:hover {
    color: var(--text);
}

.admin-settings-menu-link.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent);
}

.admin-settings-menu-link:hover {
    background: var(--surface-muted);
}

.fb-hero-btn-ghost:hover {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

/* Light theme: force white/soft surfaces + slate text where leftovers remain */
html[data-theme="light"] .main-content,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .admin-settings-panel,
html[data-theme="light"] .landing-body {
    color: var(--text);
}

html[data-theme="light"] .fb-hero,
html[data-theme="light"] .fb-toolbar,
html[data-theme="light"] .fb-post-card,
html[data-theme="light"] .ps-card,
html[data-theme="light"] .qr-card,
html[data-theme="light"] .insights-card,
html[data-theme="light"] .history-card,
html[data-theme="light"] .ao-action,
html[data-theme="light"] .admin-check,
html[data-theme="light"] .admin-plan-card,
html[data-theme="light"] .admin-social-fieldset,
html[data-theme="light"] .billing-card:not(.is-featured) {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

html[data-theme="light"] .fb-hero h1,
html[data-theme="light"] .fb-post-card,
html[data-theme="light"] .fb-post-card strong,
html[data-theme="light"] .fb-quota strong,
html[data-theme="light"] .admin-top-page,
html[data-theme="light"] .admin-top-user-name,
html[data-theme="light"] .admin-top-kicker,
html[data-theme="light"] .metric-value,
html[data-theme="light"] .ao-kpi-value,
html[data-theme="light"] .ao-kpi-label {
    color: var(--text);
}

html[data-theme="light"] .fb-hero-kicker,
html[data-theme="light"] .admin-top-user-role,
html[data-theme="light"] .admin-top-kicker {
    color: var(--primary);
}

html[data-theme="light"] .fb-hero-btn-ghost,
html[data-theme="light"] .fb-post-action,
html[data-theme="light"] .ps-tab,
html[data-theme="light"] .qr-tab,
html[data-theme="light"] .admin-settings-menu-link {
    color: var(--muted);
}

html[data-theme="light"] .fb-hero-btn-ghost:hover,
html[data-theme="light"] .ps-tab.is-active,
html[data-theme="light"] .qr-tab.is-active,
html[data-theme="light"] .admin-settings-menu-link:hover {
    color: var(--text);
    background: var(--surface-muted);
}

html[data-theme="light"] .metric-ico-blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
html[data-theme="light"] .metric-ico-green { background: rgba(5, 150, 105, 0.12); color: #059669; }
html[data-theme="light"] .metric-ico-purple { background: rgba(2, 132, 199, 0.12); color: #0284c7; }
html[data-theme="light"] .metric-ico-red { background: rgba(220, 38, 38, 0.1); color: #dc2626; }

/* Overview telemetry + directory — blue accents in light */
html[data-theme="light"] .ao-main > .dash-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .ao-chart-panel .chart-svg-box,
html[data-theme="light"] .chart-panel .chart-svg-box,
html[data-theme="light"] .chart-svg-box {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 72%);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .chart-panel .chart-labels,
html[data-theme="light"] .chart-svg-box .chart-labels {
    color: #64748b;
}

html[data-theme="light"] .activity-chart .chart-dot {
    fill: #ffffff;
    stroke: #2563eb;
}

html[data-theme="light"] .chart-panel .legend-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

html[data-theme="light"] .chart-panel .legend-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

html[data-theme="light"] .chart-panel .legend-item strong {
    color: #0f172a;
}

html[data-theme="light"] .chart-panel .legend-ok {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

html:not([data-theme="light"]) .chart-svg-box {
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 40%),
        rgba(4, 8, 16, 0.55);
    border-color: rgba(148, 163, 184, 0.1);
}

html:not([data-theme="light"]) .activity-chart .chart-dot {
    fill: #0b1220;
    stroke: #60a5fa;
}

html:not([data-theme="light"]) .legend-item {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(148, 163, 184, 0.1);
}

html[data-theme="light"] .ao-chart-panel .section-kicker,
html[data-theme="light"] .ao-main .section-kicker {
    color: #2563eb;
}

html[data-theme="light"] .ao-chart-panel .insights-pill {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.14);
}

html[data-theme="light"] .ao-chart-panel .insights-bar-track {
    background: #e2e8f0;
}

html[data-theme="light"] .ao-chart-panel .insights-bar-track span {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

html[data-theme="light"] .ao-chart-panel .insights-bar-dm span {
    background: linear-gradient(90deg, #1d4ed8, #93c5fd);
}

html[data-theme="light"] .ao-chart-panel .insights-bar-label strong {
    color: #1e3a8a;
}

html[data-theme="light"] .ao-user-row {
    border-color: transparent;
}

html[data-theme="light"] .ao-user-row:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

html[data-theme="light"] .ao-user-meta strong {
    color: #0f172a;
}

html[data-theme="light"] .ao-user-meta small {
    color: #64748b;
}

html[data-theme="light"] .ao-main .badge-primary {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

html[data-theme="light"] .ao-main .badge-muted {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] .ao-pill.is-live {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
}

html[data-theme="light"] .ao-health-list .ok {
    color: #1d4ed8;
}

html[data-theme="light"] .ao-ring-value {
    stroke: #2563eb;
}

html[data-theme="light"] .ao-kpi-teal {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

html[data-theme="light"] .form-group input:focus,
html[data-theme="light"] .form-group textarea:focus,
html[data-theme="light"] .form-group select:focus {
    background: #fff;
    border-color: #93c5fd;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .admin-sidebar {
    background-color: #ffffff;
    background-image: linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent 28%);
    color: #0f172a;
    border-right: 1px solid #e2e8f0;
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .sidebar-brand a,
html[data-theme="light"] .admin-sidebar-brand .brand-text strong {
    color: #0f172a;
}

html[data-theme="light"] .admin-sidebar-brand .brand-text small,
html[data-theme="light"] .brand-text small,
html[data-theme="light"] .nav-section-label,
html[data-theme="light"] .admin-sidebar .nav-group-label {
    color: #2563eb;
}

html[data-theme="light"] .sidebar .nav-link,
html[data-theme="light"] .admin-sidebar .nav-link {
    color: #64748b;
}

html[data-theme="light"] .sidebar .nav-link:hover,
html[data-theme="light"] .admin-sidebar .nav-link:hover {
    color: #0f172a;
    background: #f1f5f9;
}

html[data-theme="light"] .sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #4f8ff7 0%, #2563eb 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .admin-sidebar .nav-link.active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: none;
}

html[data-theme="light"] .nav-divider {
    background: #e2e8f0;
}

html[data-theme="light"] .admin-sidebar .nav-ico {
    color: #64748b;
    background: #f1f5f9;
}

html[data-theme="light"] .admin-sidebar .nav-link:hover .nav-ico {
    color: #0f172a;
    background: #e2e8f0;
}

html[data-theme="light"] .admin-sidebar .nav-link.active .nav-ico {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .admin-user-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
}

html[data-theme="light"] .admin-user-meta strong {
    color: #0f172a;
}

html[data-theme="light"] .admin-user-meta small {
    color: #64748b;
}

html[data-theme="light"] .admin-user-role {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.18);
}

html[data-theme="light"] .admin-badge-card {
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(37, 99, 235, 0.1), transparent 60%),
        #f8fafc;
}

/* Dark theme: keep admin/app rail dark */
html:not([data-theme="light"]) .admin-body .admin-sidebar,
html:not([data-theme="light"]) .sidebar {
    background-color: var(--sidebar-bg);
    background-image: linear-gradient(180deg, rgba(45, 212, 191, 0.1), transparent 24%);
    border-right-color: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
}

html:not([data-theme="light"]) .admin-sidebar-brand .brand-text strong,
html:not([data-theme="light"]) .sidebar-brand a {
    color: #fff;
}

html:not([data-theme="light"]) .admin-sidebar-brand .brand-text small,
html:not([data-theme="light"]) .nav-section-label {
    color: #5eead4;
}

html:not([data-theme="light"]) .admin-sidebar .nav-link.active {
    color: #ecfdf5;
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.22);
}

html:not([data-theme="light"]) .admin-sidebar .nav-link.active::before {
    background: #2dd4bf;
}

html:not([data-theme="light"]) .admin-sidebar .nav-link.active .nav-ico {
    background: rgba(45, 212, 191, 0.18);
    color: #5eead4;
}

html:not([data-theme="light"]) .admin-user-chip {
    background:
        linear-gradient(145deg, rgba(45, 212, 191, 0.1), transparent 55%),
        rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.16);
}

html:not([data-theme="light"]) .admin-user-meta strong { color: #f8fafc; }
html:not([data-theme="light"]) .admin-user-meta small { color: #94a3b8; }
html:not([data-theme="light"]) .admin-user-role {
    color: #99f6e4;
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.2);
}

html:not([data-theme="light"]) .admin-badge-card {
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(45, 212, 191, 0.18), transparent 60%),
        rgba(15, 23, 42, 0.72);
}

/* Dark theme: restore soft dark glass + pale text accents */
html:not([data-theme="light"]) .fb-hero h1,
html:not([data-theme="light"]) .admin-top-page,
html:not([data-theme="light"]) .admin-top-user-name {
    color: #f8fafc;
}

html:not([data-theme="light"]) .fb-hero-kicker,
html:not([data-theme="light"]) .admin-top-kicker,
html:not([data-theme="light"]) .panel-link,
html:not([data-theme="light"]) .section-kicker {
    color: #93c5fd;
}

html:not([data-theme="light"]) .fb-hero-btn-ghost {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.55);
}

html:not([data-theme="light"]) .fb-hero-btn-ghost:hover {
    color: #fff;
    background: rgba(30, 41, 59, 0.85);
}

html:not([data-theme="light"]) .admin-settings-menu-link:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.1);
}

html:not([data-theme="light"]) .admin-settings-menu-link.is-active {
    color: #fff;
    background: rgba(59, 130, 246, 0.22);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

html:not([data-theme="light"]) .metric-ico-blue { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
html:not([data-theme="light"]) .metric-ico-green { background: rgba(52, 211, 153, 0.14); color: #34d399; }
html:not([data-theme="light"]) .metric-ico-purple { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
html:not([data-theme="light"]) .metric-ico-red { background: rgba(251, 113, 133, 0.14); color: #fb7185; }

html:not([data-theme="light"]) .btn-ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

html:not([data-theme="light"]) .panel-link:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.18);
}

html:not([data-theme="light"]) .plan-panel .plan-badge {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

html:not([data-theme="light"]) .dash-hero .muted strong {
    color: #e2e8f0;
}

html:not([data-theme="light"]) .form-group input:focus,
html:not([data-theme="light"]) .form-group textarea:focus,
html:not([data-theme="light"]) .form-group select:focus {
    background: rgba(8, 13, 24, 0.95);
    border-color: rgba(96, 165, 250, 0.7);
}

/* -------- Light theme readability safety net -------- */
html[data-theme="light"] .card,
html[data-theme="light"] .dash-panel,
html[data-theme="light"] .ao-kpi,
html[data-theme="light"] .admin-check,
html[data-theme="light"] .admin-plan-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .admin-users-shell {
    color: var(--text);
}

html[data-theme="light"] .card h1,
html[data-theme="light"] .card h2,
html[data-theme="light"] .card h3,
html[data-theme="light"] .dash-panel h1,
html[data-theme="light"] .dash-panel h2,
html[data-theme="light"] .dash-panel h3,
html[data-theme="light"] .admin-hero h1,
html[data-theme="light"] .ps-hero-title,
html[data-theme="light"] .pa-hero-title,
html[data-theme="light"] .pa-card-head h2,
html[data-theme="light"] .ref-card h2,
html[data-theme="light"] .qr-hero-copy h1 {
    color: var(--text);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .help-text,
html[data-theme="light"] .panel-sub,
html[data-theme="light"] .admin-users-count,
html[data-theme="light"] .admin-activity-count,
html[data-theme="light"] .admin-user-row-joined,
html[data-theme="light"] .admin-user-row-id {
    color: var(--muted);
}

html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group textarea,
html[data-theme="light"] .form-group select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    color: var(--text);
    background: var(--input-bg);
}

html[data-theme="light"] .form-group label,
html[data-theme="light"] label {
    color: var(--text);
}

html[data-theme="light"] table th {
    color: var(--muted);
}

html[data-theme="light"] table td {
    color: var(--text);
}

html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-ghost {
    color: var(--text);
}

html[data-theme="light"] .ao-pill {
    color: var(--muted);
    background: #f1f5f9;
}

html[data-theme="light"] .admin-top-user:hover {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.06);
}

html[data-theme="light"] .admin-shell .admin-topbar {
    box-shadow: var(--shadow);
}

html[data-theme="light"] .admin-hero {
    border-color: rgba(37, 99, 235, 0.18);
    background:
        radial-gradient(700px 180px at 100% 0%, rgba(37, 99, 235, 0.1), transparent 55%),
        #fff;
}

html[data-theme="light"] .admin-pill-ok {
    color: #047857;
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.22);
}

html[data-theme="light"] .admin-pill-warn {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .ref-status.is-pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .ref-status.is-paid {
    color: #047857;
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.22);
}

html[data-theme="light"] .admin-ref-summary-warn {
    color: #92400e;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .admin-ref-steps li::before {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .lang-switch-trigger {
    color: var(--text);
    border-color: var(--border);
    background: #fff;
    box-shadow: var(--shadow);
}

html[data-theme="light"] .lang-switch-trigger .lang-code,
html[data-theme="light"] .lang-switch-trigger .lang-name {
    color: var(--text);
}

html[data-theme="light"] .lang-switch-ico,
html[data-theme="light"] .lang-chevron {
    color: var(--primary);
}

html[data-theme="light"] .lang-switch-menu {
    background: #fff;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

html[data-theme="light"] .lang-switch-option {
    color: var(--text);
}

html[data-theme="light"] .lang-switch-option .lang-name {
    color: var(--text);
}

html[data-theme="light"] .lang-switch-option .lang-code {
    color: var(--muted);
}

html[data-theme="light"] .lang-switch-option:hover {
    background: #f1f5f9;
    color: var(--text);
}

html[data-theme="light"] .lang-switch-option.is-active {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
    color: var(--primary);
}

html[data-theme="light"] .lang-switch-option.is-active .lang-code {
    color: var(--primary);
}

html[data-theme="light"] .admin-pager-num:hover {
    color: var(--text);
    background: #f1f5f9;
}

html[data-theme="light"] .admin-pager-num.is-current {
    color: #fff;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}
