@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --grey-100: #d9d9d9;
    --grey-200: #a7a7a7;
    --grey-300: #808080;
    --chloride-dark: #00856e;
    --chloride: #00ac8e;
    --chloride-light: #00d3af;
    --argon-dark: #850048;
    --argon: #af015f;
    --argon-light: #d90276;
    --oxide-dark: #fc9628;
    --oxide: #fcb828;
    --oxide-light: #fcd828;
    --lithium-dark: #370180;
    --lithium: #571b80;
    --lithium-light: #7729ed;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.16);
    --text-muted: rgba(255, 255, 255, 0.68);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--primary-white);
    background: var(--primary-black);
}

a {
    color: inherit;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 10%, rgba(0, 172, 142, 0.18), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(217, 2, 118, 0.18), transparent 45%),
        radial-gradient(circle at 75% 85%, rgba(119, 41, 237, 0.18), transparent 48%),
        radial-gradient(circle at 20% 80%, rgba(252, 184, 40, 0.16), transparent 44%),
        #020202;
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
    filter: blur(0px);
}

.auth-shell::before {
    width: 42rem;
    height: 42rem;
    right: -10rem;
    top: -14rem;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        rgba(0, 211, 175, 0.58),
        rgba(217, 2, 118, 0.5),
        rgba(119, 41, 237, 0.55),
        rgba(252, 216, 40, 0.42),
        rgba(0, 172, 142, 0.58)
    );
    opacity: 0.58;
    animation: drift-spin 28s linear infinite;
}

.auth-shell::after {
    width: 34rem;
    height: 34rem;
    left: -6rem;
    bottom: -14rem;
    border-radius: 38% 62% 58% 42% / 42% 38% 62% 58%;
    background: linear-gradient(135deg, rgba(252, 150, 40, 0.45), rgba(55, 1, 128, 0.58));
    opacity: 0.7;
    animation: morph-float 18s ease-in-out infinite;
}

.hero-panel {
    position: relative;
    padding: 2rem 2.25rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1.4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.35;
    mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.logo-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    width: fit-content;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.logo-badge img {
    width: 1.7rem;
    height: 1.7rem;
    object-fit: contain;
}

.logo-badge span {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.09em;
    font-size: 0.75rem;
}

.hero-copy {
    position: relative;
    z-index: 1;
    align-self: center;
    max-width: 42rem;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--grey-100);
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    text-transform: uppercase;
}

.hero-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.2rem, 4vw, 4.35rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    max-width: 11ch;
}

.hero-title .grad {
    display: inline-block;
    background: linear-gradient(90deg, var(--chloride-light), var(--argon-light) 45%, var(--oxide-light) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    margin: 1.15rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 55ch;
    line-height: 1.5;
}

.swatch-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.swatch {
    border-radius: 14px;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.swatch::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.95;
}

.swatch.chloride::before {
    background: linear-gradient(135deg, var(--chloride-dark), var(--chloride-light));
}

.swatch.argon::before {
    background: linear-gradient(135deg, var(--argon-dark), var(--argon-light));
}

.swatch.oxide::before {
    background: linear-gradient(135deg, var(--oxide-dark), var(--oxide-light));
}

.swatch.lithium::before {
    background: linear-gradient(135deg, var(--lithium-dark), var(--lithium-light));
}

.swatch > * {
    position: relative;
    z-index: 1;
}

.swatch strong {
    font-size: 0.78rem;
    font-family: "Space Grotesk", sans-serif;
}

.swatch span {
    font-size: 0.68rem;
    opacity: 0.9;
}

.auth-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 31rem);
    position: relative;
    z-index: 1;
    border-radius: 22px;
    padding: 1.35rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.auth-card-inner {
    border-radius: 16px;
    padding: 1.15rem;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.card-logo {
    width: 10.5rem;
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.98;
}

.auth-card h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
}

.auth-card p.lead {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.status-pill {
    margin-top: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: var(--grey-100);
    font-size: 0.73rem;
}

.status-pill .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--chloride-light);
    box-shadow: 0 0 0 5px rgba(0, 211, 175, 0.14);
}

.status-pill.error .dot {
    background: var(--argon-light);
    box-shadow: 0 0 0 5px rgba(217, 2, 118, 0.15);
}

.role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1rem;
}

.role-chip {
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.role-chip.user {
    box-shadow: inset 0 0 0 1px rgba(0, 211, 175, 0.18);
}

.role-chip.admin {
    box-shadow: inset 0 0 0 1px rgba(252, 184, 40, 0.18);
}

.role-chip.super {
    box-shadow: inset 0 0 0 1px rgba(217, 2, 118, 0.2);
}

.form-stack {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.65rem;
}

.form-field label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
    color: var(--grey-100);
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: var(--primary-white);
    padding: 0.85rem 0.9rem;
    outline: none;
    font: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: rgba(0, 211, 175, 0.58);
    box-shadow: 0 0 0 4px rgba(0, 211, 175, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.btn-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    cursor: pointer;
    color: var(--primary-white);
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(90deg, var(--chloride), var(--argon-light));
    box-shadow: 0 12px 28px rgba(217, 2, 118, 0.24);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.flash {
    margin-top: 0.8rem;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.flash.error {
    background: rgba(217, 2, 118, 0.12);
    border-color: rgba(217, 2, 118, 0.26);
    color: #ffd2e9;
}

.flash.success {
    background: rgba(0, 172, 142, 0.12);
    border-color: rgba(0, 172, 142, 0.26);
    color: #d2fff5;
}

.muted-note {
    margin-top: 0.9rem;
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.48);
    line-height: 1.45;
}

.dashboard-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 5% 5%, rgba(0, 172, 142, 0.12), transparent 34%),
        radial-gradient(circle at 95% 20%, rgba(217, 2, 118, 0.1), transparent 34%),
        radial-gradient(circle at 50% 100%, rgba(119, 41, 237, 0.12), transparent 45%),
        #040404;
    color: var(--primary-white);
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.55);
}

.dashboard-topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.dashboard-topbar .brand img {
    width: 1.6rem;
    height: 1.6rem;
}

.dashboard-topbar .brand strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.dashboard-topbar .actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dashboard-wrap {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
}

.glass-panel {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(16px);
}

.hero-dashboard {
    padding: 1.15rem;
    display: grid;
    gap: 0.8rem;
}

.hero-dashboard h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.3rem, 2vw, 2rem);
}

.hero-dashboard p {
    margin: 0;
    color: var(--text-muted);
    max-width: 60ch;
}

.pill-list {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
}

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

.placeholder-card {
    min-height: 10rem;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.placeholder-card h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.placeholder-card p {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.placeholder-card::after {
    content: "";
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -5rem;
    bottom: -5rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
}

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

.dashboard-launch-grid > * {
    min-width: 0;
}

.dashboard-launch-card {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dashboard-launch-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    opacity: 0.95;
}

.dashboard-launch-card::after {
    content: "";
    position: absolute;
    width: 14rem;
    height: 14rem;
    right: -6rem;
    top: -5rem;
    border-radius: 50%;
    opacity: 0.22;
    filter: blur(8px);
    pointer-events: none;
}

.dashboard-launch-card.consumer::before {
    background: linear-gradient(90deg, var(--chloride), var(--argon-light));
}

.dashboard-launch-card.consumer::after {
    background: radial-gradient(circle, rgba(0, 211, 175, 0.9), rgba(217, 2, 118, 0.7), transparent 70%);
}

.dashboard-launch-card.loyalty::before {
    background: linear-gradient(90deg, var(--oxide), var(--lithium-light));
}

.dashboard-launch-card.loyalty::after {
    background: radial-gradient(circle, rgba(252, 184, 40, 0.85), rgba(119, 41, 237, 0.75), transparent 70%);
}

.dashboard-launch-card.sales::before {
    background: linear-gradient(90deg, var(--chloride-light), var(--oxide-light), var(--lithium));
}

.dashboard-launch-card.sales::after {
    background: radial-gradient(circle, rgba(0, 211, 175, 0.75), rgba(252, 216, 40, 0.75), transparent 70%);
}

.dashboard-launch-card > * {
    position: relative;
    z-index: 1;
}

.dashboard-launch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dashboard-launch-head h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.02rem;
}

.dashboard-launch-card p {
    margin: 0;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.66);
}

.dashboard-launch-badge {
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.dashboard-launch-link {
    text-decoration: none;
    width: fit-content;
    padding: 0.65rem 0.85rem;
    margin-top: auto;
}

.analytics-page {
    display: grid;
    gap: 1rem;
}

.analytics-hero {
    padding: 1rem;
}

.analytics-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.analytics-hero-head h2 {
    margin: 0.25rem 0 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
    letter-spacing: -0.02em;
}

.analytics-hero-head p:last-child {
    margin: 0.6rem 0 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.5;
    max-width: 62ch;
}

.analytics-source-list {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 32rem;
}

.analytics-source-list .pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-kpi-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-kpi-grid > * {
    min-width: 0;
}

.analytics-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    display: grid;
    gap: 0.3rem;
}

.analytics-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
}

.analytics-kpi-card::after {
    content: "";
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -4rem;
    bottom: -6rem;
    border-radius: 50%;
    opacity: 0.18;
    filter: blur(4px);
}

.analytics-kpi-card.chloride::before { background: linear-gradient(90deg, var(--chloride-dark), var(--chloride-light)); }
.analytics-kpi-card.argon::before { background: linear-gradient(90deg, var(--argon-dark), var(--argon-light)); }
.analytics-kpi-card.oxide::before { background: linear-gradient(90deg, var(--oxide-dark), var(--oxide-light)); }
.analytics-kpi-card.lithium::before { background: linear-gradient(90deg, var(--lithium-dark), var(--lithium-light)); }

.analytics-kpi-card.chloride::after { background: radial-gradient(circle, rgba(0, 211, 175, 0.8), transparent 70%); }
.analytics-kpi-card.argon::after { background: radial-gradient(circle, rgba(217, 2, 118, 0.75), transparent 70%); }
.analytics-kpi-card.oxide::after { background: radial-gradient(circle, rgba(252, 184, 40, 0.8), transparent 70%); }
.analytics-kpi-card.lithium::after { background: radial-gradient(circle, rgba(119, 41, 237, 0.8), transparent 70%); }

.analytics-kpi-card > * {
    position: relative;
    z-index: 1;
}

.analytics-kpi-label {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.56);
}

.analytics-kpi-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.05rem, 2vw, 1.65rem);
    line-height: 1.05;
}

.analytics-kpi-foot {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.62);
}

.analytics-grid {
    display: grid;
    gap: 1rem;
}

.analytics-grid > * {
    min-width: 0;
}

.analytics-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-card {
    padding: 1rem;
}

.analytics-card .panel-head {
    margin-bottom: 0.9rem;
}

.bar-list {
    display: grid;
    gap: 0.7rem;
}

.bar-list-item {
    display: grid;
    gap: 0.35rem;
}

.bar-list-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.bar-list-head span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
}

.bar-list-head strong {
    font-size: 0.84rem;
    font-family: "Space Grotesk", sans-serif;
}

.bar-track {
    height: 0.52rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    min-width: 0;
}

.bar-fill.chloride { background: linear-gradient(90deg, var(--chloride-dark), var(--chloride-light)); }
.bar-fill.argon { background: linear-gradient(90deg, var(--argon-dark), var(--argon-light)); }
.bar-fill.oxide { background: linear-gradient(90deg, var(--oxide-dark), var(--oxide-light)); }
.bar-fill.lithium { background: linear-gradient(90deg, var(--lithium-dark), var(--lithium-light)); }

.funnel-stack {
    display: grid;
    gap: 0.75rem;
}

.funnel-step {
    display: grid;
    gap: 0.35rem;
}

.funnel-step-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.84rem;
}

.funnel-step-head span {
    color: rgba(255, 255, 255, 0.72);
}

.funnel-step-head strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.88rem;
}

.analytics-footline {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.analytics-footline.compact {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.analytics-footline span {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.8rem;
}

.analytics-footline strong {
    font-size: 0.86rem;
    font-family: "Space Grotesk", sans-serif;
}

.mini-bars {
    height: 13rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(2.1rem, 1fr));
    gap: 0.65rem;
    align-items: end;
}

.mini-bars-col {
    display: grid;
    gap: 0.4rem;
    justify-items: center;
}

.mini-bars-stack {
    width: 100%;
    min-height: 11rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
    padding: 0.45rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.24rem;
}

.mini-bar {
    width: 0.62rem;
    border-radius: 999px;
    min-height: 6px;
}

.mini-bars-col span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
}

.legend-row {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.legend-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

.legend-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.chloride { background: var(--chloride-light); }
.legend-dot.argon { background: var(--argon-light); }
.legend-dot.oxide { background: var(--oxide); }
.legend-dot.lithium { background: var(--lithium-light); }

.table-wrap {
    overflow: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.analytics-table th,
.analytics-table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    vertical-align: middle;
}

.analytics-table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
    z-index: 1;
}

.analytics-table tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.48rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.72rem;
    white-space: nowrap;
}

.badge.good {
    color: #d8fff6;
    border-color: rgba(0, 172, 142, 0.24);
    background: rgba(0, 172, 142, 0.12);
}

.badge.warn {
    color: #fff3ce;
    border-color: rgba(252, 184, 40, 0.22);
    background: rgba(252, 184, 40, 0.1);
}

.badge.info {
    color: #e8dcff;
    border-color: rgba(119, 41, 237, 0.2);
    background: rgba(119, 41, 237, 0.1);
}

.badge.neutral {
    color: rgba(255, 255, 255, 0.84);
}

.analytics-kpi-mini-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-mini-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    display: grid;
    gap: 0.25rem;
}

.analytics-mini-card span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.analytics-mini-card strong {
    font-family: "Space Grotesk", sans-serif;
}

.segment-meter {
    height: 1.1rem;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.segment-meter-piece {
    height: 100%;
}

.segment-meter-piece.chloride { background: linear-gradient(90deg, var(--chloride-dark), var(--chloride-light)); }
.segment-meter-piece.argon { background: linear-gradient(90deg, var(--argon-dark), var(--argon-light)); }
.segment-meter-piece.oxide { background: linear-gradient(90deg, var(--oxide-dark), var(--oxide-light)); }
.segment-meter-piece.lithium { background: linear-gradient(90deg, var(--lithium-dark), var(--lithium-light)); }

.legend-grid {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.55rem;
}

.legend-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.8rem;
}

.legend-item span {
    color: rgba(255, 255, 255, 0.66);
}

.legend-item strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
}

.heat-strip-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.45rem;
    align-items: end;
}

.heat-strip-col {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
}

.heat-strip-cell {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 5.4rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
    display: grid;
    place-items: center;
}

.heat-strip-cell::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: calc(var(--heat, 0) * 1%);
    background: linear-gradient(180deg, rgba(0, 211, 175, 0.25), rgba(217, 2, 118, 0.22), rgba(252, 184, 40, 0.28));
}

.heat-strip-cell span {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-family: "Space Grotesk", sans-serif;
}

.heat-strip-col label {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.7rem;
}

.table-inline-bar {
    width: 8.5rem;
    max-width: 100%;
    height: 0.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.consumer-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 12% 12%, rgba(0, 211, 175, 0.12), transparent 45%),
        radial-gradient(circle at 88% 16%, rgba(217, 2, 118, 0.1), transparent 40%);
}

.loyalty-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 12% 14%, rgba(252, 184, 40, 0.12), transparent 46%),
        radial-gradient(circle at 88% 18%, rgba(119, 41, 237, 0.1), transparent 42%);
}

.sales-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 10% 10%, rgba(0, 172, 142, 0.1), transparent 45%),
        radial-gradient(circle at 90% 16%, rgba(252, 216, 40, 0.1), transparent 40%);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background:
        radial-gradient(circle at 4% 8%, rgba(0, 172, 142, 0.1), transparent 38%),
        radial-gradient(circle at 96% 12%, rgba(217, 2, 118, 0.08), transparent 36%),
        radial-gradient(circle at 80% 100%, rgba(119, 41, 237, 0.09), transparent 44%),
        #050505;
}

.app-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 1rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
    position: relative;
    top: auto;
    min-height: 100vh;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.app-sidebar-brand img {
    width: 2rem;
    height: 2rem;
}

.app-sidebar-brand strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.app-sidebar-brand span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.app-sidebar-nav {
    display: grid;
    align-content: start;
    gap: 0.35rem;
}

.app-sidebar-section-title {
    margin-top: 0.8rem;
    padding: 0.25rem 0.5rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.84);
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.app-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.app-sidebar-link.active {
    background: linear-gradient(90deg, rgba(0, 172, 142, 0.15), rgba(217, 2, 118, 0.12));
    border-color: rgba(255, 255, 255, 0.09);
    color: var(--primary-white);
}

.app-sidebar-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    flex: 0 0 auto;
}

.app-sidebar-link.active .app-sidebar-dot {
    background: var(--chloride-light);
    box-shadow: 0 0 0 4px rgba(0, 211, 175, 0.14);
}

.app-sidebar-footer {
    padding: 0.9rem;
    display: grid;
    gap: 0.2rem;
}

.app-sidebar-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
}

.app-sidebar-footer strong {
    font-size: 0.95rem;
    font-family: "Space Grotesk", sans-serif;
}

.app-sidebar-footer span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.app-main {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    width: 100%;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 2, 2, 0.75);
    backdrop-filter: blur(14px);
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.app-topbar-left > div {
    min-width: 0;
}

.app-topbar-left h1 {
    margin: 0.15rem 0 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.35rem;
    overflow-wrap: anywhere;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-overlay {
    display: none;
}

.mobile-nav-toggle,
.mobile-nav-close {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary-white);
    border-radius: 12px;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.mobile-nav-toggle:hover,
.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mobile-nav-toggle span,
.mobile-nav-close span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
}

.mobile-nav-toggle span:nth-child(1) {
    transform: translate(-50%, -7px);
}

.mobile-nav-toggle span:nth-child(2) {
    transform: translate(-50%, -1px);
}

.mobile-nav-toggle span:nth-child(3) {
    transform: translate(-50%, 5px);
}

.mobile-nav-close span:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-nav-close span:nth-child(2) {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-nav-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
}

.theme-icon-toggle {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.theme-icon-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.theme-icon-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 211, 175, 0.12);
    border-color: rgba(0, 211, 175, 0.32);
}

.theme-icon {
    position: absolute;
    font-size: 1rem;
    line-height: 1;
    transition: opacity 120ms ease, transform 120ms ease;
}

.theme-icon-sun {
    opacity: 0;
    transform: scale(0.85) rotate(-10deg);
}

.theme-dark .theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-dark .theme-icon-sun {
    opacity: 0;
    transform: scale(0.85) rotate(-10deg);
}

.theme-light .theme-icon-moon {
    opacity: 0;
    transform: scale(0.85) rotate(10deg);
}

.theme-light .theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.auth-theme-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
}

.app-top-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.app-top-menu a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-size: 0.83rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.app-top-menu a.active {
    color: var(--primary-white);
    border-color: rgba(255, 255, 255, 0.11);
    background: linear-gradient(90deg, rgba(0, 172, 142, 0.1), rgba(119, 41, 237, 0.11));
}

.account-dropdown {
    position: relative;
}

.account-dropdown summary {
    list-style: none;
}

.account-dropdown summary::-webkit-details-marker {
    display: none;
}

.account-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary-white);
    font-weight: 600;
    user-select: none;
}

.account-dropdown[open] .account-dropdown-trigger {
    border-color: rgba(0, 211, 175, 0.28);
    box-shadow: 0 0 0 4px rgba(0, 211, 175, 0.08);
}

.account-caret {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    transform: rotate(45deg) translateY(-1px);
    transition: transform 120ms ease;
}

.account-dropdown[open] .account-caret {
    transform: rotate(-135deg) translateY(-1px);
}

.account-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.45rem);
    min-width: 12rem;
    display: grid;
    gap: 0.25rem;
    border-radius: 14px;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 8, 8, 0.96);
    box-shadow: var(--shadow-xl);
}

.account-dropdown-menu a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
    border: 1px solid transparent;
}

.account-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.app-content {
    padding: 1rem;
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.app-content > * {
    min-width: 0;
}

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

.panel-head h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
    align-items: start;
}

.profile-hero-card,
.profile-details-card,
.profile-access-card,
.profile-activity-card {
    padding: 1rem;
}

.profile-hero-card {
    grid-column: 1 / -1;
}

.profile-hero-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-white);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 55%),
        linear-gradient(135deg, var(--chloride), var(--argon-light) 55%, var(--lithium-light));
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.05),
        0 12px 28px rgba(0, 0, 0, 0.35);
}

.profile-hero-top h2 {
    margin: 0.2rem 0 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.35rem;
}

.profile-hero-top p:last-child {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

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

.profile-stat {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    padding: 0.75rem;
    display: grid;
    gap: 0.3rem;
}

.profile-stat span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-stat strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
    line-height: 1.2;
    word-break: break-word;
}

.profile-field-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-span-2 {
    grid-column: span 2;
}

.profile-field {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem;
    min-height: 5.1rem;
}

.profile-field label {
    display: block;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 0.35rem;
}

.profile-field div {
    font-size: 0.92rem;
    line-height: 1.35;
    word-break: break-word;
}

.profile-action-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.profile-copy {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.activity-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.65rem;
}

.activity-list li {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 0.8rem 0.75rem 1.15rem;
    display: grid;
    gap: 0.2rem;
}

.activity-list li::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 0.95rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: var(--chloride-light);
    box-shadow: 0 0 0 4px rgba(0, 211, 175, 0.12);
}

.activity-list strong {
    font-size: 0.9rem;
}

.activity-list span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

.profile-activity-wide {
    grid-column: 1 / -1;
}

.system-manager-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
}

.system-inline-form {
    display: inline-flex;
}

.system-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.system-select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: var(--primary-white);
    padding: 0.85rem 0.9rem;
    outline: none;
    font: inherit;
}

.system-select option {
    color: #000;
}

.system-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 0.85rem;
    min-height: 3rem;
}

.system-checkbox input {
    accent-color: var(--chloride);
}

.system-checkbox span {
    font-size: 0.86rem;
}

.user-manager-list {
    display: grid;
    gap: 0.85rem;
}

.user-row-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.85rem;
    display: grid;
    gap: 0.8rem;
}

.user-row-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.user-row-head strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
}

.user-row-head span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
}

.user-row-form {
    display: grid;
    gap: 0.7rem;
}

.system-user-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.system-delete-form {
    display: inline-flex;
}

html.theme-light body,
body.theme-light {
    color: #121317;
    background:
        radial-gradient(circle at 10% 10%, rgba(0, 172, 142, 0.12), transparent 40%),
        radial-gradient(circle at 92% 10%, rgba(217, 2, 118, 0.1), transparent 38%),
        radial-gradient(circle at 85% 88%, rgba(119, 41, 237, 0.1), transparent 42%),
        radial-gradient(circle at 8% 86%, rgba(252, 184, 40, 0.14), transparent 44%),
        #f6f7fa;
}

.theme-light .auth-shell {
    background:
        linear-gradient(135deg, rgba(0, 172, 142, 0.08), transparent 35%),
        linear-gradient(225deg, rgba(217, 2, 118, 0.07), transparent 40%),
        radial-gradient(circle at 18% 16%, rgba(0, 211, 175, 0.14), transparent 42%),
        radial-gradient(circle at 88% 18%, rgba(217, 2, 118, 0.12), transparent 40%),
        radial-gradient(circle at 76% 86%, rgba(119, 41, 237, 0.12), transparent 44%),
        radial-gradient(circle at 16% 84%, rgba(252, 184, 40, 0.16), transparent 46%),
        #f4f6fa;
}

.theme-light .hero-panel {
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .hero-grid {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

.theme-light .logo-badge {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .logo-badge span,
.theme-light .hero-title,
.theme-light .auth-card h1,
.theme-light .app-topbar-left h1,
.theme-light .manager-header h1,
.theme-light .panel-head h3,
.theme-light .placeholder-card h2,
.theme-light .profile-hero-top h2,
.theme-light .profile-stat strong,
.theme-light .user-row-head strong,
.theme-light .app-sidebar-brand strong,
.theme-light .app-sidebar-footer strong,
.theme-light .dashboard-launch-head h2,
.theme-light .analytics-hero-head h2,
.theme-light .analytics-kpi-value,
.theme-light .bar-list-head strong,
.theme-light .funnel-step-head strong,
.theme-light .legend-item strong,
.theme-light .analytics-footline strong,
.theme-light .analytics-mini-card strong,
.theme-light .heat-strip-cell span {
    color: #14171b;
}

.theme-light .eyebrow,
.theme-light .hero-subtitle,
.theme-light .auth-card p.lead,
.theme-light .muted-note,
.theme-light .hero-dashboard p,
.theme-light .placeholder-card p,
.theme-light .profile-copy,
.theme-light .profile-hero-top p:last-child,
.theme-light .manager-header p,
.theme-light .app-sidebar-brand span,
.theme-light .app-sidebar-footer span,
.theme-light .app-sidebar-footer p,
.theme-light .user-row-head span,
.theme-light .activity-list span,
.theme-light .dashboard-launch-card p,
.theme-light .analytics-hero-head p:last-child,
.theme-light .analytics-kpi-foot,
.theme-light .analytics-kpi-label,
.theme-light .bar-list-head span,
.theme-light .funnel-step-head span,
.theme-light .analytics-footline span,
.theme-light .legend-row span,
.theme-light .legend-item span,
.theme-light .analytics-mini-card span,
.theme-light .heat-strip-col label {
    color: rgba(20, 23, 27, 0.65);
}

.theme-light .theme-switcher,
.theme-light .logo-badge,
.theme-light .auth-card,
.theme-light .auth-card-inner,
.theme-light .glass-panel,
.theme-light .app-sidebar-brand,
.theme-light .app-sidebar,
.theme-light .app-topbar,
.theme-light .account-dropdown-trigger,
.theme-light .account-dropdown-menu,
.theme-light .profile-stat,
.theme-light .profile-field,
.theme-light .user-row-card,
.theme-light .activity-list li,
.theme-light .system-checkbox,
.theme-light .status-pill,
.theme-light .pill,
.theme-light .app-top-menu a,
.theme-light .app-sidebar-link,
.theme-light .dashboard-launch-badge,
.theme-light .analytics-table th,
.theme-light .analytics-table td,
.theme-light .table-wrap,
.theme-light .bar-track,
.theme-light .segment-meter,
.theme-light .analytics-mini-card,
.theme-light .heat-strip-cell,
.theme-light .table-inline-bar,
.theme-light .mini-bars-stack {
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .auth-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8)),
        linear-gradient(135deg, rgba(0, 172, 142, 0.05), rgba(217, 2, 118, 0.04));
}

.theme-light .auth-card-inner {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.7));
}

.theme-light .app-shell {
    background:
        linear-gradient(120deg, rgba(0, 172, 142, 0.05), transparent 28%),
        linear-gradient(235deg, rgba(217, 2, 118, 0.045), transparent 30%),
        radial-gradient(circle at 4% 8%, rgba(0, 172, 142, 0.12), transparent 38%),
        radial-gradient(circle at 96% 12%, rgba(217, 2, 118, 0.11), transparent 36%),
        radial-gradient(circle at 80% 100%, rgba(119, 41, 237, 0.1), transparent 44%),
        radial-gradient(circle at 10% 94%, rgba(252, 184, 40, 0.12), transparent 38%),
        #f3f5f9;
}

.theme-light .app-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.78)),
        linear-gradient(180deg, rgba(0, 172, 142, 0.03), rgba(119, 41, 237, 0.03));
    border-right-color: rgba(0, 0, 0, 0.08);
}

.theme-light .app-topbar {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82)),
        linear-gradient(90deg, rgba(0, 172, 142, 0.03), rgba(217, 2, 118, 0.03));
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.theme-light .app-topbar .eyebrow {
    color: rgba(20, 23, 27, 0.6) !important;
}

.theme-light .glass-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68)),
        linear-gradient(135deg, rgba(0, 172, 142, 0.03), rgba(217, 2, 118, 0.02), rgba(119, 41, 237, 0.03));
    box-shadow: 0 18px 40px rgba(14, 18, 26, 0.08);
}

.theme-light .app-sidebar-link {
    color: rgba(20, 23, 27, 0.82);
}

.theme-light .app-sidebar-link:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

.theme-light .app-sidebar-link.active {
    color: #111418;
    background: linear-gradient(90deg, rgba(0, 172, 142, 0.14), rgba(217, 2, 118, 0.1));
}

.theme-light .app-sidebar-dot {
    background: rgba(0, 0, 0, 0.2);
}

.theme-light .pill,
.theme-light .status-pill,
.theme-light .app-top-menu a {
    background: rgba(0, 0, 0, 0.025);
    color: rgba(20, 23, 27, 0.82);
}

.theme-light .dashboard-launch-badge,
.theme-light .analytics-table thead th,
.theme-light .mini-bars-stack,
.theme-light .heat-strip-cell,
.theme-light .analytics-mini-card {
    background: rgba(0, 0, 0, 0.02);
}

.theme-light .table-wrap {
    background: rgba(0, 0, 0, 0.008);
}

.theme-light .analytics-table thead th {
    color: rgba(20, 23, 27, 0.56);
}

.theme-light .analytics-table td {
    border-bottom-color: rgba(0, 0, 0, 0.045);
}

.theme-light .bar-track,
.theme-light .segment-meter,
.theme-light .table-inline-bar {
    background: rgba(0, 0, 0, 0.03);
}

.theme-light .badge {
    color: rgba(20, 23, 27, 0.86);
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .badge.neutral {
    color: rgba(20, 23, 27, 0.86);
}

.theme-light .badge.good {
    color: #0f5b4c;
    background: rgba(0, 172, 142, 0.08);
    border-color: rgba(0, 172, 142, 0.18);
}

.theme-light .badge.warn {
    color: #855f09;
    background: rgba(252, 184, 40, 0.12);
    border-color: rgba(252, 184, 40, 0.22);
}

.theme-light .badge.info {
    color: #4b287d;
    background: rgba(119, 41, 237, 0.1);
    border-color: rgba(119, 41, 237, 0.18);
}

.theme-light .consumer-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 12% 12%, rgba(0, 211, 175, 0.16), transparent 45%),
        radial-gradient(circle at 88% 16%, rgba(217, 2, 118, 0.11), transparent 40%);
}

.theme-light .loyalty-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 12% 14%, rgba(252, 184, 40, 0.18), transparent 46%),
        radial-gradient(circle at 88% 18%, rgba(119, 41, 237, 0.12), transparent 42%);
}

.theme-light .sales-accent .analytics-hero {
    background-image:
        radial-gradient(circle at 10% 10%, rgba(0, 172, 142, 0.12), transparent 45%),
        radial-gradient(circle at 90% 16%, rgba(252, 216, 40, 0.14), transparent 40%);
}

.theme-light .theme-icon-toggle {
    background:
        linear-gradient(135deg, rgba(0, 172, 142, 0.08), rgba(217, 2, 118, 0.07), rgba(119, 41, 237, 0.08));
    color: #121317;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.theme-light .theme-icon-toggle:hover {
    background:
        linear-gradient(135deg, rgba(0, 172, 142, 0.12), rgba(217, 2, 118, 0.1), rgba(119, 41, 237, 0.12));
    border-color: rgba(0, 0, 0, 0.11);
}

.theme-light .mobile-nav-toggle,
.theme-light .mobile-nav-close {
    color: #121317;
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.theme-light .mobile-nav-toggle:hover,
.theme-light .mobile-nav-close:hover {
    background: rgba(0, 0, 0, 0.04);
}

.theme-light .account-dropdown-trigger {
    background: rgba(0, 0, 0, 0.02);
    color: #111418;
}

.theme-light .account-caret {
    border-right-color: rgba(20, 23, 27, 0.75);
    border-bottom-color: rgba(20, 23, 27, 0.75);
}

.theme-light .account-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
}

.theme-light .account-dropdown-menu a {
    color: #15181c;
}

.theme-light .account-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.04);
}

.theme-light .form-field label,
.theme-light .profile-field label,
.theme-light .profile-stat span {
    color: rgba(20, 23, 27, 0.6);
}

.theme-light .form-field input,
.theme-light .form-field textarea,
.theme-light .form-field select,
.theme-light .system-select {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
    color: #121317;
}

.theme-light .form-field input::placeholder,
.theme-light .form-field textarea::placeholder {
    color: rgba(20, 23, 27, 0.35);
}

.theme-light .form-field input:focus,
.theme-light .form-field textarea:focus,
.theme-light .form-field select:focus,
.theme-light .system-select:focus {
    background: rgba(255, 255, 255, 0.8);
}

.theme-light .btn.secondary {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #121317;
}

.theme-light .placeholder-card::after {
    background: radial-gradient(circle, rgba(119, 41, 237, 0.12), transparent 70%);
}

.theme-light .status-pill.error,
.theme-light .flash.error {
    color: #7d123f;
    background: rgba(217, 2, 118, 0.08);
    border-color: rgba(217, 2, 118, 0.18);
}

.theme-light .flash.success {
    color: #0f5b4c;
    background: rgba(0, 172, 142, 0.08);
    border-color: rgba(0, 172, 142, 0.18);
}

.manager-shell {
    min-height: 100vh;
    background: #060606;
    color: var(--primary-white);
    padding: 1rem;
}

.manager-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.manager-header {
    padding: 1rem;
}

.manager-header h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
}

.manager-header p {
    margin: 0.4rem 0 0;
    color: var(--text-muted);
}

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

.manager-card {
    padding: 1rem;
}

.manager-card h2 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-family: "Space Grotesk", sans-serif;
}

.manager-card form {
    display: grid;
    gap: 0.75rem;
}

.manager-card small {
    color: rgba(255, 255, 255, 0.5);
}

.sql-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem;
    overflow: auto;
    white-space: pre-wrap;
}

.danger {
    background: linear-gradient(90deg, #6e022f, #d90276);
}

.manager-footer {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    padding: 0 0.25rem 1rem;
}

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: 20rem;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hero-title {
        max-width: none;
        font-size: clamp(1.8rem, 6vw, 2.7rem);
    }

    .swatch-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-panel {
        padding-top: 0.75rem;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        border: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
    }

    .theme-light .mobile-nav-overlay {
        background: rgba(14, 18, 26, 0.22);
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        height: 100dvh;
        z-index: 50;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 0;
        grid-template-rows: auto 1fr auto;
        transform: translateX(calc(-100% - 12px));
        transition: transform 180ms ease;
        overflow-y: auto;
        background:
            linear-gradient(180deg, rgba(6, 7, 10, 0.985), rgba(6, 7, 10, 0.985)),
            linear-gradient(180deg, rgba(0, 172, 142, 0.03), rgba(119, 41, 237, 0.03));
        backdrop-filter: blur(12px);
    }

    .theme-light .app-sidebar {
        background:
            linear-gradient(180deg, rgba(248, 249, 252, 0.99), rgba(246, 247, 251, 0.99)),
            linear-gradient(180deg, rgba(0, 172, 142, 0.04), rgba(119, 41, 237, 0.04));
    }

    .mobile-nav-open .app-sidebar {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.35);
    }

    .mobile-nav-open .mobile-nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-open body,
    body.mobile-nav-open {
        overflow: hidden;
    }

    .mobile-nav-open .app-main {
        pointer-events: none;
        user-select: none;
    }

    .mobile-nav-open .app-sidebar,
    .mobile-nav-open .mobile-nav-overlay {
        pointer-events: auto;
    }

    .app-sidebar-brand {
        padding-right: 3.2rem;
    }

    .mobile-nav-toggle,
    .mobile-nav-close {
        display: inline-block;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        flex-direction: row;
        align-items: center;
        padding: 0.8rem 0.9rem;
        gap: 0.6rem;
    }

    .app-topbar-left {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        gap: 0.7rem;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }

    .app-topbar-right {
        width: auto;
        margin-left: 0;
        justify-content: flex-end;
        gap: 0.45rem;
        flex-wrap: nowrap;
        flex: 0 0 auto;
        padding-top: 0;
        border-top: 0;
    }

    .app-topbar-left h1 {
        font-size: 1.05rem;
        line-height: 1.1;
    }

    .app-topbar-left .eyebrow {
        font-size: 0.68rem;
    }

    .account-dropdown {
        margin-left: 0;
        max-width: 100%;
    }

    .account-dropdown-trigger {
        padding: 0.55rem 0.7rem;
        max-width: 100%;
        white-space: nowrap;
    }

    .account-dropdown-menu {
        min-width: 10.5rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-stat-grid,
    .profile-field-grid,
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-span-2 {
        grid-column: auto;
    }

    .system-manager-grid,
    .system-user-grid,
    .system-two-col {
        grid-template-columns: 1fr;
    }

    .dashboard-launch-grid,
    .analytics-kpi-grid,
    .analytics-grid-2 {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-mini-grid {
        grid-template-columns: 1fr;
    }

    .analytics-hero-head {
        flex-direction: column;
    }

    .analytics-source-list {
        justify-content: flex-start;
    }

    .heat-strip-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .manager-grid,
    .placeholder-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .auth-panel {
        padding: 0.75rem;
    }

    .auth-card {
        border-radius: 18px;
        padding: 0.9rem;
    }

    .auth-card-inner {
        padding: 0.95rem;
    }

    .hero-panel {
        padding: 1.15rem 1rem;
        min-height: 16rem;
    }

    .hero-title {
        font-size: clamp(1.55rem, 8vw, 2.15rem);
    }

    .dashboard-launch-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-icon-toggle,
    .mobile-nav-toggle,
    .mobile-nav-close {
        width: 2.35rem;
        height: 2.35rem;
        border-radius: 10px;
    }

    .theme-icon {
        font-size: 0.9rem;
    }

    .app-topbar-left .eyebrow {
        display: none;
    }

    .app-topbar-left h1 {
        margin-top: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1rem;
    }

    .account-dropdown-trigger {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }

    .heat-strip-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .app-content {
        padding: 0.8rem;
    }

    .analytics-source-list .pill {
        font-size: 0.68rem;
        max-width: 100%;
    }

    .mini-bars {
        gap: 0.4rem;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        height: 11rem;
    }

    .mini-bars-stack {
        min-height: 9rem;
        padding: 0.3rem;
        gap: 0.16rem;
    }

    .mini-bar {
        width: 0.46rem;
    }

    .analytics-table {
        min-width: 520px;
    }

    .analytics-table th,
    .analytics-table td {
        padding: 0.55rem 0.5rem;
        font-size: 0.76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@keyframes drift-spin {
    from {
        transform: rotate(0deg) translate3d(0, 0, 0);
    }
    to {
        transform: rotate(360deg) translate3d(0, 0, 0);
    }
}

@keyframes morph-float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        border-radius: 38% 62% 58% 42% / 42% 38% 62% 58%;
    }
    50% {
        transform: translateY(-14px) rotate(8deg);
        border-radius: 62% 38% 42% 58% / 58% 62% 38% 42%;
    }
}
