:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #101828;
    --ink-soft: #344054;
    --muted: #667085;
    --line: #e7ebf1;
    --line-strong: #d8dee8;
    --navy: #0b1220;
    --navy-soft: #131e32;
    --mint: #17b890;
    --mint-bright: #54ddbe;
    --mint-soft: #e8faf5;
    --cyan: #38b8e8;
    --coral: #ff7a6b;
    --coral-soft: #fff1ef;
    --amber: #f4ae45;
    --amber-soft: #fff7e8;
    --violet: #7d77ed;
    --shadow-sm: 0 6px 24px rgba(17, 30, 48, .055);
    --shadow-md: 0 18px 55px rgba(17, 30, 48, .09);
    --shadow-lg: 0 34px 90px rgba(8, 18, 36, .16);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mint);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.eyebrow--light {
    color: #86ebd5;
}

.live-dot {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(23, 184, 144, .12);
}

.live-dot::after {
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(23, 184, 144, .4);
    border-radius: inherit;
    content: "";
    animation: live-pulse 2s infinite;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 650;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

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

.button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.button svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.9;
}

.button--primary {
    color: #fff;
    background: var(--mint);
    box-shadow: 0 8px 20px rgba(23, 184, 144, .2);
}

.button--primary:hover {
    background: #13a985;
    box-shadow: 0 10px 26px rgba(23, 184, 144, .28);
}

.button--outline {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, .74);
}

.button--outline:hover {
    border-color: #bcc7d5;
    background: #fff;
}

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

.button--danger {
    color: #d13f36;
    background: var(--coral-soft);
}

.button--large {
    min-height: 52px;
    border-radius: 14px;
    font-size: 15px;
}

.icon-button {
    position: relative;
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-soft);
    background: #fff;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.brand-mark {
    position: relative;
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    overflow: hidden;
    border-radius: 11px;
    background: var(--navy);
}

.brand-mark::before {
    position: absolute;
    top: -16px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(84, 221, 190, .24);
    content: "";
}

.brand-mark i {
    position: relative;
    display: block;
    width: 4px;
    border-radius: 4px 4px 2px 2px;
    background: #74e6cc;
}

.brand-mark i:nth-child(1) {
    height: 8px;
}

.brand-mark i:nth-child(2) {
    height: 15px;
}

.brand-mark i:nth-child(3) {
    height: 11px;
}

.brand-mark--light {
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
    backdrop-filter: blur(16px);
}

/* Login */
.login-page {
    overflow-x: hidden;
    background: #f7f8fa;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(520px, 1.16fr) minmax(430px, .84fr);
}

.login-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 46px 54px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 10%, rgba(40, 203, 167, .2), transparent 28%),
        linear-gradient(150deg, #06101b 0%, #0b1825 52%, #102337 100%);
}

.login-visual__image {
    position: absolute;
    inset: 0;
    opacity: .72;
    background-image: url("/assets/login-hero.jpg");
    background-position: center;
    background-size: cover;
    transform: scale(1.012);
}

.login-visual__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 13, 24, .84) 0%, rgba(5, 13, 24, .44) 52%, rgba(5, 13, 24, .74) 100%),
        linear-gradient(0deg, rgba(3, 11, 20, .88) 0%, transparent 55%);
}

.login-brand,
.login-copy,
.login-preview-card,
.login-footer {
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .02em;
}

.login-copy {
    width: min(620px, 88%);
    margin: auto 0 19vh;
}

.login-copy h1 {
    max-width: 600px;
    margin: 24px 0 20px;
    font-size: clamp(48px, 5.1vw, 76px);
    font-weight: 640;
    letter-spacing: -.056em;
    line-height: 1.02;
}

.login-copy h1 em {
    color: #6de9ce;
    font-style: normal;
}

.login-copy p {
    max-width: 500px;
    margin: 0;
    color: rgba(238, 248, 250, .65);
    font-size: 16px;
    line-height: 1.8;
}

.glass-card {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(14, 28, 43, .58);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .24);
    backdrop-filter: blur(20px);
}

.login-preview-card {
    position: absolute;
    right: 7.5%;
    bottom: 9%;
    width: min(390px, 38%);
    padding: 20px 22px 17px;
    border-radius: 20px;
    animation: float-card 6s ease-in-out infinite;
}

.preview-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.preview-card__top span {
    display: block;
    color: rgba(235, 245, 247, .58);
    font-size: 11px;
}

.preview-card__top strong {
    display: block;
    margin-top: 7px;
    font-size: 24px;
    font-weight: 590;
    letter-spacing: -.025em;
}

.preview-card__top .trend-pill {
    display: inline-flex;
    width: auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.trend-pill--up {
    color: #78efd5;
    background: rgba(62, 216, 179, .12);
}

.preview-chart {
    height: 82px;
    margin: 9px -4px 4px;
}

.preview-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.preview-chart .line {
    filter: drop-shadow(0 0 8px rgba(108, 233, 203, .5));
}

.preview-metrics {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(235, 245, 247, .55);
    font-size: 10px;
}

.preview-metrics span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.preview-metrics b {
    margin-left: auto;
    color: rgba(235, 245, 247, .72);
    font-weight: 500;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot--mint {
    background: #6ce9cb;
}

.dot--coral {
    background: #ff8b79;
}

.login-footer {
    color: rgba(238, 248, 250, .36);
    font-size: 11px;
    letter-spacing: .02em;
}

.login-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 48px;
    background:
        radial-gradient(circle at 90% 12%, rgba(23, 184, 144, .055), transparent 28%),
        #fbfcfd;
}

.login-panel__inner {
    width: min(400px, 100%);
}

.login-panel__brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 56px;
    font-size: 14px;
    font-weight: 700;
}

.login-heading {
    margin-bottom: 34px;
}

.login-heading h2 {
    margin: 15px 0 8px;
    font-size: 37px;
    font-weight: 650;
    letter-spacing: -.045em;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span:first-child {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 620;
}

.input-shell {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.input-shell:focus-within {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(23, 184, 144, .09);
}

.input-shell > svg {
    width: 18px;
    height: 18px;
    margin-left: 16px;
    color: #8d99aa;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.input-shell input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
}

.input-shell input::placeholder {
    color: #aab3c0;
}

.password-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    color: #8792a3;
    background: transparent;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    margin: auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.check {
    display: flex;
    align-items: center;
    gap: 7px;
}

.check input {
    width: 15px;
    height: 15px;
    accent-color: var(--mint);
}

.login-submit {
    width: 100%;
    margin-top: 3px;
}

.login-submit svg {
    margin-left: auto;
}

.login-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: #8994a3;
    font-size: 10px;
}

.login-trust span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-trust i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #78cdb7;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12px;
}

.alert--error {
    color: #b33b32;
    background: var(--coral-soft);
}

.alert__icon {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--coral);
    font-size: 12px;
    font-weight: 800;
}

/* Dashboard shell */
.dashboard-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
}

#app {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: 248px;
    flex-direction: column;
    overflow-y: auto;
    padding: 26px 18px 20px;
    color: #e8eef5;
    background:
        radial-gradient(circle at 12% 3%, rgba(41, 193, 160, .16), transparent 24%),
        radial-gradient(circle at 105% 92%, rgba(71, 115, 174, .13), transparent 34%),
        #0b1220;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px;
}

.sidebar__brand > div {
    display: grid;
    gap: 1px;
}

.sidebar__brand strong {
    font-size: 16px;
    font-weight: 680;
    letter-spacing: .01em;
}

.sidebar__brand span:not(.brand-mark) {
    color: rgba(229, 240, 246, .38);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: .21em;
}

.workspace-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 2px 24px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
}

.workspace-chip__avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: #bff7e9;
    background: rgba(78, 219, 186, .12);
    font-size: 14px;
    font-weight: 700;
}

.workspace-chip > div:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.workspace-chip span {
    color: rgba(233, 242, 246, .38);
    font-size: 9px;
}

.workspace-chip strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-chip__live {
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: #55dfbd;
    box-shadow: 0 0 0 4px rgba(85, 223, 189, .08);
}

.side-nav {
    display: grid;
    gap: 3px;
}

.side-nav__label {
    margin: 20px 12px 8px;
    color: rgba(233, 242, 246, .26);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .15em;
}

.side-nav__label:first-child {
    margin-top: 0;
}

.nav-item {
    position: relative;
    display: flex;
    width: 100%;
    height: 42px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: 11px;
    color: rgba(232, 239, 245, .54);
    background: transparent;
    font-size: 12px;
    text-align: left;
    transition: color .16s ease, background .16s ease;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.7;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .045);
}

.nav-item.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(47, 202, 166, .22), rgba(47, 202, 166, .1));
    box-shadow: inset 0 0 0 1px rgba(90, 227, 194, .06);
}

.nav-item.is-active::before {
    position: absolute;
    left: 0;
    width: 3px;
    height: 19px;
    border-radius: 0 3px 3px 0;
    background: #5de0c0;
    content: "";
}

.nav-item.is-active svg {
    color: #68e3c7;
}

.nav-live {
    margin-left: auto;
    padding: 2px 5px;
    border-radius: 4px;
    color: #72e7cc;
    background: rgba(77, 217, 182, .1);
    font-size: 7px;
    letter-spacing: .06em;
}

.sidebar__support {
    position: relative;
    display: grid;
    gap: 7px;
    margin-top: auto;
    padding: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(31, 68, 78, .75), rgba(13, 27, 40, .8));
}

.sidebar__support::after {
    position: absolute;
    top: -34px;
    right: -32px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(77, 219, 186, .1);
    content: "";
}

.support-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    color: #7cebd2;
    background: rgba(71, 221, 185, .1);
}

.support-icon svg {
    width: 14px;
    height: 14px;
}

.sidebar__support strong {
    position: relative;
    z-index: 1;
    font-size: 11px;
}

.sidebar__support span {
    position: relative;
    z-index: 1;
    color: rgba(237, 245, 247, .42);
    font-size: 9px;
    line-height: 1.6;
}

.sidebar__support button {
    width: fit-content;
    padding: 0;
    color: #7ee6cf;
    background: transparent;
    font-size: 9px;
    font-weight: 600;
}

.main-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-column: 2;
}

.topbar {
    position: sticky;
    z-index: 25;
    top: 0;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid rgba(220, 226, 234, .75);
    background: rgba(247, 249, 252, .86);
    backdrop-filter: blur(18px);
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
}

.topbar__left {
    gap: 12px;
}

.topbar__right {
    gap: 11px;
}

.topbar__context {
    display: grid;
    gap: 1px;
}

.topbar__breadcrumb {
    color: #9aa4b2;
    font-size: 9px;
}

.topbar__context h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 690;
    letter-spacing: -.025em;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .7);
    font-size: 9px;
}

.system-status .live-dot {
    width: 6px;
    height: 6px;
}

.notification-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 5px;
    height: 5px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: var(--coral);
}

.profile-menu {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 7px 4px 4px;
    border-radius: 12px;
    background: transparent;
}

.profile-button:hover {
    background: rgba(255, 255, 255, .8);
}

.profile-button > svg {
    width: 13px;
    height: 13px;
    color: #9ba5b3;
}

.profile-avatar {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #18314c, #0b1422);
    font-size: 12px;
    font-weight: 700;
}

.profile-copy {
    display: grid;
    min-width: 70px;
    gap: 0;
    text-align: left;
}

.profile-copy strong {
    font-size: 11px;
    font-weight: 650;
}

.profile-copy small {
    color: #98a2b1;
    font-size: 8px;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    width: 190px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.profile-dropdown.is-open {
    display: grid;
    gap: 4px;
    animation: menu-in .16s ease both;
}

.profile-dropdown span {
    color: var(--muted);
    font-size: 9px;
}

.profile-dropdown strong {
    margin-bottom: 8px;
    font-size: 12px;
}

.profile-dropdown form {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.profile-dropdown button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 8px 0 0;
    color: var(--coral);
    background: transparent;
    font-size: 11px;
}

.profile-dropdown button svg {
    width: 14px;
    height: 14px;
}

.mobile-menu {
    display: none;
}

.toolbar {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 30px;
}

.toolbar__filters,
.toolbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-shell {
    position: relative;
    display: flex;
    min-width: 164px;
    height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
}

.select-shell svg {
    width: 14px;
    height: 14px;
    color: #8792a3;
}

.select-shell select {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 11px;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .74);
}

.segmented button {
    min-width: 62px;
    height: 30px;
    padding: 0 11px;
    border-radius: 7px;
    color: #7e8997;
    background: transparent;
    font-size: 10px;
}

.segmented button.is-active {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 3px 12px rgba(21, 34, 51, .08);
    font-weight: 650;
}

.sync-time {
    color: #98a2ae;
    font-size: 9px;
}

.page-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: calc(100vh - 148px);
    padding: 0 30px 32px;
}

.page-loader {
    display: flex;
    min-height: 380px;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.page-loader span {
    width: 5px;
    height: 18px;
    border-radius: 4px;
    background: var(--mint);
    animation: loader-bar 1s ease-in-out infinite;
}

.page-loader span:nth-child(2) {
    animation-delay: .12s;
}

.page-loader span:nth-child(3) {
    animation-delay: .24s;
}

.page-loader p {
    margin-left: 9px;
    color: var(--muted);
    font-size: 11px;
}

/* Content primitives */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 6px 0 20px;
}

.page-head h3 {
    margin: 7px 0 3px;
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -.035em;
}

.page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.page-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.kpi-card {
    position: relative;
    min-height: 152px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(227, 232, 239, .94);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.kpi-card::after {
    position: absolute;
    right: -30px;
    bottom: -45px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--card-glow, rgba(23, 184, 144, .06));
    content: "";
}

.kpi-card--mint {
    --card-glow: rgba(23, 184, 144, .09);
}

.kpi-card--blue {
    --card-glow: rgba(56, 184, 232, .09);
}

.kpi-card--amber {
    --card-glow: rgba(244, 174, 69, .1);
}

.kpi-card--coral {
    --card-glow: rgba(255, 122, 107, .09);
}

.kpi-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-card__label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 560;
}

.metric-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    color: var(--mint);
    background: var(--mint-soft);
}

.metric-icon--blue {
    color: #269dd0;
    background: #eaf7fd;
}

.metric-icon--amber {
    color: #d89427;
    background: var(--amber-soft);
}

.metric-icon--coral {
    color: #e56458;
    background: var(--coral-soft);
}

.metric-icon svg {
    width: 16px;
    height: 16px;
}

.kpi-card__value {
    position: relative;
    z-index: 1;
    margin-top: 17px;
    font-size: clamp(24px, 2.1vw, 31px);
    font-weight: 650;
    letter-spacing: -.04em;
    line-height: 1;
}

.kpi-card__value small {
    margin-left: 2px;
    color: #7c8795;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
}

.kpi-card__bottom {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    color: #8b96a3;
    font-size: 9px;
}

.change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 650;
}

.change--up {
    color: var(--mint);
}

.change--down {
    color: var(--coral);
}

.change svg {
    width: 10px;
    height: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(280px, .78fr);
    gap: 14px;
}

.dashboard-grid > *,
.section-grid > *,
.realtime-grid > *,
.integration-grid > *,
.security-layout > *,
.ads-layout > * {
    min-width: 0;
}

.card {
    min-width: 0;
    border: 1px solid rgba(227, 232, 239, .94);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 0;
}

.card__title {
    display: grid;
    gap: 2px;
}

.card__title h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 680;
}

.card__title span {
    color: var(--muted);
    font-size: 9px;
}

.card__body {
    padding: 20px;
}

.chart-card {
    min-height: 390px;
}

.chart-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 8px;
}

.chart-card__header h4 {
    margin: 0 0 3px;
    font-size: 13px;
    font-weight: 680;
}

.chart-card__header span {
    color: var(--muted);
    font-size: 9px;
}

.legend {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 9px;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.chart-wrap {
    position: relative;
    height: 294px;
    padding: 0 15px 8px;
}

.chart-total {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 8px 20px 0;
}

.chart-total strong {
    font-size: 24px;
    font-weight: 640;
    letter-spacing: -.035em;
}

.chart-total span {
    color: var(--muted);
    font-size: 9px;
}

.side-stack {
    display: grid;
    gap: 14px;
}

.realtime-card {
    position: relative;
    overflow: hidden;
    color: #f2f8fa;
    background:
        radial-gradient(circle at 88% 0%, rgba(70, 217, 183, .22), transparent 32%),
        linear-gradient(145deg, #0d1a29, #0a1320);
}

.realtime-card::after {
    position: absolute;
    right: -48px;
    bottom: -52px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(100, 229, 203, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 24px rgba(100, 229, 203, .03), 0 0 0 50px rgba(100, 229, 203, .018);
    content: "";
}

.realtime-card .card__header {
    position: relative;
    z-index: 1;
}

.realtime-card .card__title h4 {
    color: #f4f9fb;
}

.realtime-card .card__title span {
    color: rgba(233, 244, 247, .4);
}

.online-number {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 19px 20px 6px;
}

.online-number strong {
    font-size: 41px;
    font-weight: 610;
    letter-spacing: -.05em;
    line-height: 1;
}

.online-number span {
    padding-bottom: 5px;
    color: rgba(233, 244, 247, .45);
    font-size: 10px;
}

.mini-bars {
    position: relative;
    z-index: 1;
    display: flex;
    height: 64px;
    align-items: flex-end;
    gap: 4px;
    padding: 10px 20px 0;
}

.mini-bars i {
    display: block;
    min-height: 5px;
    flex: 1;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(0deg, rgba(66, 214, 180, .18), rgba(99, 231, 202, .76));
    animation: bar-grow .48s ease both;
}

.realtime-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 20px 20px;
}

.realtime-stats div {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
}

.realtime-stats span {
    display: block;
    color: rgba(234, 244, 247, .4);
    font-size: 8px;
}

.realtime-stats strong {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 600;
}

.funnel-card .card__body {
    padding-top: 17px;
}

.funnel {
    display: grid;
    gap: 12px;
}

.funnel-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
}

.funnel-row span {
    color: var(--muted);
    font-size: 9px;
}

.funnel-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #f0f3f7;
}

.funnel-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #24be9a, #66e1c5);
}

.funnel-row:nth-child(2) .funnel-track i {
    background: linear-gradient(90deg, #31a9d4, #72d8f1);
}

.funnel-row:nth-child(3) .funnel-track i {
    background: linear-gradient(90deg, #d6a23e, #f4ca72);
}

.funnel-row:nth-child(4) .funnel-track i {
    background: linear-gradient(90deg, #dd7460, #ffab98);
}

.funnel-row strong {
    font-size: 10px;
    font-weight: 650;
    text-align: right;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr);
    gap: 14px;
    margin-top: 14px;
}

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

.game-table th {
    padding: 11px 12px;
    color: #98a2b0;
    font-size: 8px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.game-table th:first-child,
.game-table td:first-child {
    padding-left: 20px;
}

.game-table th:last-child,
.game-table td:last-child {
    padding-right: 20px;
    text-align: right;
}

.game-table td {
    padding: 12px;
    border-top: 1px solid #f0f2f6;
    font-size: 10px;
}

.game-cell {
    display: flex;
    min-width: 180px;
    align-items: center;
    gap: 10px;
}

.game-thumb {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, #18324c, #0d1a2b);
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-cell strong {
    display: block;
    max-width: 150px;
    overflow: hidden;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-cell small {
    color: #9aa3af;
    font-size: 8px;
}

.table-value {
    font-weight: 640;
}

.table-value small {
    display: block;
    color: #a2abb6;
    font-size: 8px;
    font-weight: 400;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 600;
}

.badge::before {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    content: "";
}

.badge--active {
    color: #168a6e;
    background: var(--mint-soft);
}

.badge--active::before {
    background: var(--mint);
}

.badge--pending {
    color: #a57118;
    background: var(--amber-soft);
}

.badge--pending::before {
    background: var(--amber);
}

.badge--paused {
    color: #7e8997;
    background: #f1f3f6;
}

.badge--paused::before {
    background: #9aa4b2;
}

.activity-feed {
    display: grid;
    padding: 10px 20px 18px;
}

.activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.activity-item:not(:last-child) {
    border-bottom: 1px solid #f2f4f7;
}

.activity-icon {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 9px;
    color: var(--mint);
    background: var(--mint-soft);
}

.activity-icon svg {
    width: 14px;
    height: 14px;
}

.activity-copy {
    min-width: 0;
}

.activity-copy strong {
    display: block;
    overflow: hidden;
    font-size: 9px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-copy span,
.activity-time {
    color: #98a2ae;
    font-size: 8px;
}

.empty-state {
    display: grid;
    min-height: 260px;
    place-items: center;
    padding: 30px;
    text-align: center;
}

.empty-state__inner {
    max-width: 320px;
}

.empty-state__icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 16px;
    color: var(--mint);
    background: var(--mint-soft);
}

.empty-state__icon svg {
    width: 24px;
    height: 24px;
}

.empty-state h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

/* Realtime page */
.realtime-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(120px, .45fr));
    gap: 16px;
    margin-bottom: 14px;
    padding: 25px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(circle at 84% 0%, rgba(79, 222, 188, .24), transparent 34%),
        linear-gradient(130deg, #0a1422, #102237);
    box-shadow: var(--shadow-md);
}

.realtime-hero::before {
    position: absolute;
    top: -80px;
    right: 20%;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(95, 225, 196, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(95, 225, 196, .025), 0 0 0 88px rgba(95, 225, 196, .014);
    content: "";
}

.realtime-hero__main,
.realtime-stat {
    position: relative;
    z-index: 1;
}

.realtime-hero__main h3 {
    margin: 12px 0 4px;
    font-size: 30px;
    font-weight: 630;
    letter-spacing: -.035em;
}

.realtime-hero__main p {
    margin: 0;
    color: rgba(236, 246, 248, .46);
    font-size: 10px;
}

.realtime-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 17px;
    border-left: 1px solid rgba(255, 255, 255, .09);
}

.realtime-stat span {
    color: rgba(236, 246, 248, .42);
    font-size: 9px;
}

.realtime-stat strong {
    margin-top: 5px;
    font-size: 22px;
    font-weight: 620;
    letter-spacing: -.03em;
}

.realtime-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr);
    gap: 14px;
}

.callback-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.callback-flow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    padding: 13px 16px;
    overflow-x: auto;
    border: 1px solid rgba(23, 184, 144, .14);
    border-radius: 14px;
    color: #667085;
    background: linear-gradient(90deg, rgba(232, 250, 245, .72), rgba(255, 255, 255, .8));
    font-size: 12px;
    white-space: nowrap;
}

.callback-flow span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.callback-flow b {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 7px;
    color: #168d73;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 135, 111, .1);
    font-size: 10px;
}

.callback-flow svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: #b7c1cc;
}

.callback-flow .is-live {
    color: #15876e;
    font-weight: 650;
}

.callback-kpi {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(circle at 110% -10%, var(--kpi-glow, rgba(23, 184, 144, .08)), transparent 42%),
        #fff;
    box-shadow: var(--shadow-sm);
}

.callback-kpi--mint {
    --kpi-glow: rgba(23, 184, 144, .13);
}

.callback-kpi--amber {
    --kpi-glow: rgba(244, 174, 69, .14);
}

.callback-kpi--blue {
    --kpi-glow: rgba(56, 184, 232, .13);
}

.callback-kpi--coral {
    --kpi-glow: rgba(255, 122, 107, .13);
}

.callback-kpi--violet {
    --kpi-glow: rgba(125, 119, 237, .12);
}

.callback-kpi > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.callback-kpi span:not(.metric-icon) {
    color: var(--muted);
    font-size: 8px;
}

.callback-kpi strong {
    overflow: hidden;
    font-size: 17px;
    font-weight: 680;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.callback-kpi small {
    overflow: hidden;
    color: #98a2ae;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.callback-table {
    min-width: 1260px;
}

.table-extra {
    display: block;
    margin-top: 2px;
    color: #98a2ae;
    font-size: 7px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-grid > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfcfd;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 8px;
}

.detail-grid strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    font-weight: 550;
    overflow-wrap: anywhere;
}

.json-preview {
    max-height: 260px;
    margin: 0;
    overflow: auto;
    padding: 15px;
    border-radius: 12px;
    color: #dce8ee;
    background: #0e1724;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    line-height: 1.7;
}

.live-feed {
    max-height: 472px;
    overflow: auto;
    padding: 12px 20px 18px;
}

.live-feed::-webkit-scrollbar {
    width: 5px;
}

.live-feed::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background: #d9dfe7;
}

.live-event {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f3f6;
}

.live-event__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #1a9a7d;
    background: var(--mint-soft);
}

.live-event__icon svg {
    width: 15px;
    height: 15px;
}

.live-event__copy {
    min-width: 0;
}

.live-event__copy strong {
    display: block;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-event__copy span {
    color: #98a2af;
    font-size: 8px;
}

.event-code {
    padding: 3px 6px;
    border-radius: 5px;
    color: #326b5f;
    background: #eef8f5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
}

.event-code--pay {
    color: #b25d4e;
    background: #fff3f0;
}

.event-code--ad {
    color: #9a6d1e;
    background: #fff8e9;
}

/* Games page */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.mini-stat__icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    color: var(--mint);
    background: var(--mint-soft);
}

.mini-stat__icon svg {
    width: 17px;
    height: 17px;
}

.mini-stat span {
    display: block;
    color: var(--muted);
    font-size: 8px;
}

.mini-stat strong {
    display: block;
    margin-top: 3px;
    font-size: 17px;
    font-weight: 650;
}

.game-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.game-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.game-card__cover {
    position: relative;
    height: 138px;
    overflow: hidden;
    background: linear-gradient(145deg, #142c44, #0b1320);
}

.game-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.game-card:hover .game-card__cover img {
    transform: scale(1.035);
}

.game-card__cover::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(7, 16, 28, .56), transparent 62%);
    content: "";
}

.game-card__status {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 12px;
}

.game-card__body {
    padding: 16px;
}

.game-card__title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.game-card__title h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 680;
}

.game-card__title span {
    display: block;
    margin-top: 2px;
    color: #98a2ae;
    font-size: 8px;
}

.game-card__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #f0f2f5;
}

.game-card__metrics span {
    display: block;
    color: #98a2ae;
    font-size: 7px;
}

.game-card__metrics strong {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 650;
}

.game-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
}

.key-pill {
    display: inline-flex;
    max-width: 150px;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: #8c97a5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-pill svg {
    width: 11px;
    height: 11px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: #5b6a7d;
    background: transparent;
    font-size: 9px;
    font-weight: 600;
}

.link-button:hover {
    color: var(--mint);
}

.link-button svg {
    width: 13px;
    height: 13px;
}

/* Tables and filters */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-bar .select-shell {
    min-width: 180px;
}

.search-shell {
    display: flex;
    min-width: 210px;
    height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
}

.search-shell svg {
    width: 14px;
    height: 14px;
    color: #96a0ad;
}

.search-shell input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 10px;
}

.data-table-card {
    overflow: hidden;
}

.data-table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table-wrap .game-table {
    min-width: 620px;
}

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

.data-table th {
    padding: 13px 15px;
    color: #919ba8;
    background: #fafbfd;
    font-size: 8px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 15px;
    border-top: 1px solid #f0f2f5;
    font-size: 9px;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #fbfcfd;
}

.mono {
    max-width: 220px;
    overflow: hidden;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-top: 1px solid #f0f2f5;
    color: #97a1ae;
    font-size: 8px;
}

/* Ads */
.ads-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
}

.ad-game-list {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 10px;
}

.ad-game-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 15px;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: 10px;
    background: transparent;
    text-align: left;
}

.ad-game-item:hover,
.ad-game-item.is-active {
    background: #f3f8f7;
}

.ad-game-item img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
}

.ad-game-item strong {
    display: block;
    font-size: 9px;
}

.ad-game-item span {
    display: block;
    color: #96a0ad;
    font-size: 7px;
}

.ad-game-item svg {
    width: 13px;
    height: 13px;
    color: #9aa4b1;
}

.ad-form-card {
    padding: 21px;
}

.ad-form-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 21px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.ad-form-head img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.ad-form-head h4 {
    margin: 0;
    font-size: 15px;
}

.ad-form-head p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 9px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .field--full {
    grid-column: 1 / -1;
}

.form-control {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    font-size: 11px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

textarea.form-control {
    min-height: 90px;
    padding-top: 11px;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(23, 184, 144, .08);
}

.form-hint {
    color: #98a2ae;
    font-size: 8px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 14px;
    font-size: 11px;
    font-weight: 680;
}

.form-section-title::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.advanced-drawer {
    margin-top: 26px;
    border-top: 1px solid var(--line);
}

.advanced-drawer > summary {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 10px;
    padding: 15px 0 4px;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 650;
    list-style: none;
}

.advanced-drawer > summary::-webkit-details-marker {
    display: none;
}

.advanced-drawer > summary::after {
    margin-left: auto;
    color: #98a2ae;
    content: "展开";
    font-size: 11px;
    font-weight: 500;
}

.advanced-drawer[open] > summary::after {
    content: "收起";
}

.advanced-drawer > summary svg {
    width: 18px;
    height: 18px;
    color: var(--mint);
}

.advanced-drawer > summary span {
    color: #98a2ae;
    font-size: 11px;
    font-weight: 400;
}

.callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 12px;
    color: #665534;
    background: #fff9eb;
    font-size: 9px;
    line-height: 1.7;
}

.callout svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin-top: 1px;
    color: #d19a36;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 21px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.qr-preview-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background:
        radial-gradient(circle at 95% 0%, rgba(23, 184, 144, .1), transparent 34%),
        #fbfcfd;
}

.qr-preview-block__copy {
    min-width: 0;
    flex: 1;
}

.qr-preview-block__copy h4 {
    margin: 7px 0 4px;
    font-size: 16px;
}

.qr-preview-block__copy p {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 11px;
}

.qr-preview-code {
    display: grid;
    width: 184px;
    height: 184px;
    flex: 0 0 184px;
    place-items: center;
    overflow: hidden;
    border: 8px solid #fff;
    border-radius: 14px;
    color: #a1abb7;
    background: #fff;
    box-shadow: 0 9px 30px rgba(20, 35, 53, .1);
}

.qr-preview-code svg {
    width: 42px;
    height: 42px;
}

.qr-preview-code img,
.qr-preview-code canvas {
    max-width: 100%;
    height: auto;
}

/* Integration */
.integration-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, .72fr);
    gap: 14px;
}

.code-card {
    overflow: hidden;
    color: #dce6ee;
    background: #0e1724;
}

.code-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.code-card__header strong {
    font-size: 10px;
}

.code-card__header span {
    color: rgba(220, 230, 238, .4);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
}

.code-card__header button {
    color: #82e7d1;
    background: transparent;
    font-size: 8px;
}

.code-card pre {
    max-height: 405px;
    margin: 0;
    padding: 20px;
    overflow: auto;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 10px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.token-highlight {
    color: #76dfc8;
}

.string-highlight {
    color: #f1c879;
}

.integration-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.integration-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfcfd;
}

.integration-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.integration-item h4 {
    margin: 0;
    font-size: 10px;
}

.integration-item p {
    margin: 4px 0 10px;
    color: var(--muted);
    font-size: 8px;
}

.copy-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.copy-row code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-row button {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 8px;
    color: #607083;
    background: #eef2f6;
}

.copy-row button svg {
    width: 12px;
    height: 12px;
}

/* Customers */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.customer-card {
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.customer-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-logo {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #1b3d50, #0b1a2a);
    font-size: 13px;
    font-weight: 700;
}

.customer-card__head h4 {
    margin: 0;
    font-size: 13px;
}

.customer-card__head span {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 8px;
}

.customer-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.customer-card__metrics span {
    display: block;
    color: #98a2ae;
    font-size: 8px;
}

.customer-card__metrics strong {
    display: block;
    margin-top: 3px;
    font-size: 13px;
}

.customer-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

/* Security */
.security-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 14px;
}

.security-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--line);
}

.security-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px;
    background: #fff;
}

.security-row__icon {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border-radius: 10px;
    color: var(--mint);
    background: var(--mint-soft);
}

.security-row__icon svg {
    width: 16px;
    height: 16px;
}

.security-row__copy {
    min-width: 0;
    flex: 1;
}

.security-row__copy strong {
    display: block;
    font-size: 10px;
}

.security-row__copy span {
    color: var(--muted);
    font-size: 8px;
}

.security-state {
    color: #188f73;
    font-size: 8px;
    font-weight: 650;
}

/* Modal and notification */
.modal-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 14, 24, .55);
    backdrop-filter: blur(7px);
}

.modal-backdrop.is-open {
    display: flex;
    animation: fade-in .18s ease both;
}

.modal {
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    animation: modal-in .23s cubic-bezier(.2, .75, .25, 1) both;
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 21px 23px 17px;
    border-bottom: 1px solid var(--line);
}

.modal__header h3 {
    margin: 4px 0 0;
    font-size: 19px;
    letter-spacing: -.025em;
}

#modal-body {
    padding: 22px 23px 24px;
}

.toast-stack {
    position: fixed;
    z-index: 130;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 8px;
}

.toast {
    display: flex;
    width: min(330px, calc(100vw - 40px));
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 13px;
    color: #eaf3f6;
    background: rgba(11, 24, 38, .94);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    font-size: 10px;
    animation: toast-in .25s ease both;
}

.toast--error {
    background: rgba(83, 31, 29, .95);
}

.toast__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint-bright);
}

.toast--error .toast__dot {
    background: #ff9b8f;
}

.sidebar-scrim {
    display: none;
}

.error-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 30px;
    background:
        radial-gradient(circle at 50% 35%, rgba(23, 184, 144, .13), transparent 34%),
        #f5f7fa;
}

.error-page main {
    text-align: center;
}

.error-page main > span {
    color: var(--mint);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .25em;
}

.error-page h1 {
    margin: 12px 0 5px;
    font-size: 36px;
    letter-spacing: -.04em;
}

.error-page p {
    margin: 0 0 20px;
    color: var(--muted);
}

@keyframes live-pulse {
    0%, 100% { transform: scale(.78); opacity: .15; }
    50% { transform: scale(1.2); opacity: .75; }
}

@keyframes float-card {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes loader-bar {
    0%, 100% { height: 12px; opacity: .45; }
    50% { height: 25px; opacity: 1; }
}

@keyframes bar-grow {
    from { height: 0; }
}

@keyframes menu-in {
    from { transform: translateY(-5px); opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes modal-in {
    from { transform: translateY(12px) scale(.985); opacity: 0; }
}

@keyframes toast-in {
    from { transform: translateY(8px); opacity: 0; }
}

@media (max-width: 1180px) {
    #app {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar {
        width: 220px;
    }

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

    .game-card-grid {
        grid-template-columns: 1fr 1fr;
    }

    .realtime-hero {
        grid-template-columns: 1.2fr repeat(3, .48fr);
    }

    .callback-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .login-preview-card {
        width: 42%;
    }
}

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

    .login-visual {
        display: none;
    }

    .login-panel__brand {
        display: flex;
    }

    .login-panel {
        padding: 34px 24px;
    }

    #app {
        display: block;
    }

    .sidebar {
        width: 260px;
        transform: translateX(-104%);
        transition: transform .25s cubic-bezier(.2, .75, .25, 1);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        z-index: 35;
        inset: 0;
        display: none;
        width: 100%;
        height: 100%;
        padding: 0;
        background: rgba(6, 13, 23, .45);
    }

    .sidebar-scrim.is-open {
        display: block;
    }

    .mobile-menu {
        display: inline-grid;
    }

    .dashboard-grid,
    .section-grid,
    .realtime-grid,
    .integration-grid,
    .security-layout {
        grid-template-columns: 1fr;
    }

    .game-card-grid,
    .customer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ads-layout {
        grid-template-columns: 1fr;
    }

    .ad-game-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .topbar,
    .toolbar,
    .page-content {
        padding-right: 20px;
        padding-left: 20px;
    }
}

@media (max-width: 680px) {
    .topbar {
        min-height: 68px;
    }

    .topbar__breadcrumb,
    .system-status,
    .profile-copy,
    .profile-button > svg {
        display: none;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .toolbar__filters,
    .toolbar__actions {
        width: 100%;
        justify-content: space-between;
    }

    .select-shell {
        min-width: 0;
        flex: 1;
    }

    .segmented {
        flex: 0 0 auto;
    }

    .segmented button {
        min-width: 49px;
        padding: 0 7px;
    }

    .sync-time {
        display: none;
    }

    .kpi-grid,
    .stats-strip,
    .callback-kpis,
    .detail-grid,
    .game-card-grid,
    .customer-grid {
        grid-template-columns: 1fr;
    }

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

    .page-head__actions {
        width: 100%;
    }

    .realtime-hero {
        grid-template-columns: 1fr 1fr;
    }

    .realtime-hero__main {
        grid-column: 1 / -1;
    }

    .realtime-stat {
        padding: 10px 0 0;
        border-top: 1px solid rgba(255, 255, 255, .09);
        border-left: 0;
    }

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

    .qr-preview-block {
        align-items: flex-start;
        flex-direction: column;
    }

    .ad-game-list {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        max-height: 90vh;
        border-radius: 22px 22px 0 0;
    }

    .login-heading h2 {
        font-size: 32px;
    }

    .login-options .muted {
        display: none;
    }
}

/* Readability pass: operational data screens must remain legible at normal zoom. */
body {
    font-size: 16px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    font-size: 15px;
}

.icon-button {
    width: 42px;
    height: 42px;
}

.nav-item {
    height: 47px;
    gap: 13px;
    padding: 0 14px;
    font-size: 14px;
}

.nav-item svg {
    width: 19px;
    height: 19px;
}

.side-nav__label {
    margin: 22px 12px 9px;
    font-size: 10px;
}

.workspace-chip span {
    font-size: 10px;
}

.workspace-chip strong {
    font-size: 14px;
}

.sidebar__support strong {
    font-size: 13px;
}

.sidebar__support span {
    font-size: 11px;
}

.sidebar__support button {
    font-size: 11px;
}

.topbar__breadcrumb,
.sync-time {
    font-size: 11px;
}

.topbar__context h2 {
    font-size: 22px;
}

.system-status {
    font-size: 11px;
}

.profile-copy strong {
    font-size: 13px;
}

.profile-copy small {
    font-size: 10px;
}

.select-shell,
.search-shell {
    height: 43px;
}

.select-shell select,
.search-shell input {
    font-size: 13px;
}

.segmented button {
    min-width: 72px;
    height: 34px;
    font-size: 12px;
}

.eyebrow {
    font-size: 12px;
}

.page-head h3 {
    font-size: 29px;
}

.page-head p {
    font-size: 13px;
}

.kpi-card {
    min-height: 166px;
    padding: 22px;
}

.kpi-card__label {
    font-size: 13px;
}

.metric-icon {
    width: 38px;
    height: 38px;
}

.metric-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-card__value {
    margin-top: 19px;
    font-size: clamp(29px, 2.2vw, 36px);
}

.kpi-card__bottom {
    margin-top: 16px;
    font-size: 11px;
}

.card__title h4,
.chart-card__header h4 {
    font-size: 16px;
}

.card__title span,
.chart-card__header span,
.legend {
    font-size: 11px;
}

.chart-total span,
.online-number span {
    font-size: 11px;
}

.realtime-stats span,
.funnel-row span {
    font-size: 10px;
}

.funnel-row strong,
.table-value,
.game-table td,
.data-table td {
    font-size: 12px;
}

.game-table th,
.data-table th {
    font-size: 11px;
}

.game-cell strong,
.activity-copy strong,
.live-event__copy strong {
    font-size: 12px;
}

.game-cell small,
.activity-copy span,
.activity-time,
.live-event__copy span,
.table-value small,
.table-extra {
    font-size: 10px;
}

.event-code {
    font-size: 10px;
}

.badge {
    padding: 5px 8px;
    font-size: 10px;
}

.empty-state h4 {
    font-size: 17px;
}

.empty-state p {
    font-size: 12px;
}

.callback-kpi {
    min-height: 96px;
    padding: 18px;
}

.callback-kpi span:not(.metric-icon) {
    font-size: 11px;
}

.callback-kpi strong {
    font-size: 22px;
}

.callback-kpi small {
    font-size: 10px;
}

.form-control,
.field > span:first-child,
.field > span:first-child {
    font-size: 13px;
}

.form-control {
    min-height: 48px;
}

textarea.form-control {
    font-size: 13px;
}

.form-hint,
.callout,
.integration-item p {
    font-size: 11px;
}

.integration-item h4 {
    font-size: 12px;
}

.code-card pre {
    font-size: 12px;
}

.copy-row code,
.key-pill,
.mono {
    font-size: 10px;
}

.modal__header h3 {
    font-size: 22px;
}

.detail-grid span {
    font-size: 10px;
}

.detail-grid strong,
.json-preview {
    font-size: 11px;
}

.customer-card__head h4 {
    font-size: 15px;
}

.customer-card__metrics span,
.customer-card__metrics strong {
    font-size: 11px;
}

.security-row__copy strong {
    font-size: 13px;
}

.security-row__copy span,
.security-state {
    font-size: 10px;
}

/* Final readability floor: no operational text below 12px. */
body {
    font-size: 17px;
}

.nav-item {
    height: 50px;
    font-size: 15px;
}

.side-nav__label {
    font-size: 11px;
}

.workspace-chip span,
.topbar__breadcrumb,
.sync-time {
    font-size: 12px;
}

.workspace-chip strong {
    font-size: 15px;
}

.topbar__context h2 {
    font-size: 24px;
}

.page-head h3 {
    font-size: 32px;
}

.page-head p {
    font-size: 14px;
}

.eyebrow,
.select-shell select,
.search-shell input,
.segmented button {
    font-size: 13px;
}

.card__title h4,
.chart-card__header h4 {
    font-size: 18px;
}

.card__title span,
.chart-card__header span,
.legend,
.kpi-card__bottom,
.form-hint {
    font-size: 12px;
}

.kpi-card__label {
    font-size: 14px;
}

.kpi-card__bottom,
.activity-copy span,
.activity-time,
.live-event__copy span,
.table-value small,
.table-extra,
.callback-kpi small {
    font-size: 11px;
}

.game-table th,
.data-table th {
    font-size: 12px;
}

.game-table td,
.data-table td,
.game-cell strong,
.activity-copy strong,
.live-event__copy strong,
.table-value {
    font-size: 13px;
}

.game-cell small {
    font-size: 11px;
}

.badge,
.event-code {
    font-size: 11px;
}

.callback-flow {
    font-size: 13px;
}

.callback-kpi span:not(.metric-icon) {
    font-size: 12px;
}

.callback-kpi strong {
    font-size: 24px;
}

.field > span:first-child,
.form-control,
textarea.form-control {
    font-size: 14px;
}

.callout,
.integration-item p,
.integration-item h4 {
    font-size: 13px;
}

.copy-row code,
.key-pill,
.mono,
.code-card pre {
    font-size: 12px;
}

.customer-card__head h4,
.security-row__copy strong {
    font-size: 14px;
}

.customer-card__head span,
.customer-card__metrics span,
.customer-card__metrics strong,
.security-row__copy span,
.security-state,
.detail-grid span,
.detail-grid strong,
.json-preview {
    font-size: 12px;
}
