* {
    box-sizing: border-box;
}


:root {
    --bg: #050505;

    --surface: rgba(14,14,15,.91);
    --surface2: rgba(21,21,22,.94);

    --text: #f4f1e9;
    --muted: #8d8981;

    --gold: #c7a65e;
    --gold-light: #ead39b;
    --gold-soft: rgba(199,166,94,.10);

    --green: #58d99a;
    --green-soft: rgba(88,217,154,.09);

    --red: #e97878;
    --red-soft: rgba(233,120,120,.08);

    --border: rgba(220,184,100,.13);

    --radius: 19px;
}


html {
    background: var(--bg);
}


body {
    margin: 0;

    min-height: 100vh;

    background: #050505;

    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    overflow-x: hidden;

    isolation: isolate;
}


button,
input,
textarea {
    font: inherit;
}


button {
    -webkit-tap-highlight-color:
        transparent;
}


.bg {
    position: fixed;

    inset: 0;

    z-index: -1;

    overflow: hidden;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(202,169,91,.065),
            transparent 36%
        );
}


.wave {
    position: absolute;

    width: 900px;
    height: 1300px;

    border-radius: 50%;

    border:
        1px solid
        rgba(220,184,100,.065);
}


.wave::before,
.wave::after {
    content: "";

    position: absolute;

    border-radius: inherit;
}


.wave::before {
    inset: 48px;

    border:
        1px solid
        rgba(245,220,160,.04);
}


.wave::after {
    inset: 115px;

    border:
        1px solid
        rgba(200,160,73,.05);
}


.wave-left {
    left: -650px;
    top: -270px;

    transform:
        rotate(-17deg);
}


.wave-right {
    right: -670px;
    top: -300px;

    transform:
        rotate(18deg);
}


.app {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 800px;

    margin: 0 auto;

    padding:
        28px
        20px
        115px;
}


.topbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 34px;
}


.brand {
    display: flex;

    align-items: baseline;

    gap: 12px;
}


.brand-main {
    font-size: 19px;

    font-weight: 650;

    letter-spacing: .16em;
}


.brand-sub {
    color: var(--gold-light);

    font-size: 10px;

    font-weight: 600;

    letter-spacing: .28em;
}


.avatar {
    width: 40px;
    height: 40px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background: var(--surface);

    border:
        1px solid
        var(--border);

    color: var(--gold-light);
}


.back {
    display: none;

    width: fit-content;

    margin-bottom: 21px;

    color: var(--muted);

    font-size: 13px;

    cursor: pointer;
}


.back:hover {
    color: var(--gold-light);
}


.eyebrow {
    margin-bottom: 9px;

    color: var(--gold);

    text-transform: uppercase;

    letter-spacing: .27em;

    font-size: 9px;
}


h1 {
    margin: 0 0 27px;

    font-size: 31px;

    font-weight: 520;

    letter-spacing: -.7px;
}


h2 {
    margin: 0;

    font-size: 18px;

    font-weight: 570;
}


.section-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin:
        31px
        1px
        13px;
}


.count {
    min-width: 34px;
    height: 27px;

    padding: 0 10px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 999px;

    border:
        1px solid
        rgba(220,184,100,.20);

    background:
        var(--gold-soft);

    color: var(--gold-light);

    font-size: 11px;

    font-weight: 600;
}


.summary {
    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap: 10px;

    margin-bottom: 32px;
}


.kpi {
    min-height: 116px;

    padding: 17px;

    border:
        1px solid
        var(--border);

    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.025),
            transparent
        ),
        var(--surface);
}


.kpi-icon {
    margin-bottom: 17px;

    color: var(--gold-light);

    font-size: 17px;
}


.kpi-value {
    font-size: 23px;

    font-weight: 650;
}


.kpi-label {
    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;
}


.card {
    margin-bottom: 11px;

    padding: 19px;

    border:
        1px solid
        var(--border);

    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.022),
            transparent
        ),
        var(--surface);

    cursor: pointer;

    transition:
        transform .2s,
        border-color .2s;
}


.card:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(220,184,100,.28);
}


.card-top {
    display: flex;

    justify-content: space-between;

    gap: 15px;
}


.title {
    font-size: 16px;

    font-weight: 620;
}


.meta {
    margin-top: 6px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.55;
}


.arrow {
    flex-shrink: 0;

    width: 29px;
    height: 29px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    border:
        1px solid
        rgba(255,255,255,.04);

    background:
        rgba(255,255,255,.025);

    color: var(--muted);
}


.metrics {
    display: grid;

    grid-template-columns:
        repeat(3,1fr);

    gap: 8px;

    margin-top: 16px;
}


.metric {
    padding: 11px;

    border-radius: 12px;

    background:
        rgba(255,255,255,.022);
}


.metric-value {
    font-size: 14px;

    font-weight: 620;
}


.metric-label {
    margin-top: 4px;

    color: var(--muted);

    font-size: 9px;
}


.hero {
    padding: 22px;

    margin-bottom: 14px;

    border:
        1px solid
        var(--border);

    border-radius: 21px;

    background:
        linear-gradient(
            130deg,
            rgba(202,168,93,.06),
            transparent
        ),
        var(--surface);
}


.hero-name {
    font-size: 22px;

    font-weight: 570;
}


.hero-meta {
    margin-top: 8px;

    color: var(--muted);

    font-size: 11px;
}


.page-actions,
.action-row {
    display: grid;

    grid-template-columns:
        repeat(2,1fr);

    gap: 9px;

    margin: 14px 0;
}


.page-actions.single {
    grid-template-columns: 1fr;
}


.main-action {
    width: 100%;

    padding: 13px 15px;

    border-radius: 13px;

    border:
        1px solid
        rgba(220,184,100,.24);

    background:
        linear-gradient(
            135deg,
            rgba(202,168,93,.14),
            rgba(202,168,93,.035)
        );

    color: var(--gold-light);

    font-size: 11px;

    font-weight: 650;

    cursor: pointer;
}


.main-action.secondary {
    border-color:
        rgba(255,255,255,.07);

    background:
        rgba(255,255,255,.025);

    color: var(--text);
}


.main-action.danger {
    border-color:
        rgba(233,120,120,.20);

    background:
        rgba(233,120,120,.05);

    color: var(--red);
}


.main-action:disabled {
    opacity: .45;

    cursor: default;
}


.metric-grid {
    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    gap: 9px;
}


.big-metric {
    padding: 17px;

    border:
        1px solid
        var(--border);

    border-radius: 17px;

    background:
        var(--surface);
}


.big-label {
    color: var(--muted);

    font-size: 9px;
}


.big-value {
    margin-top: 8px;

    font-size: 21px;

    font-weight: 630;
}


.delta {
    margin-top: 5px;

    font-size: 9px;
}


.delta.good {
    color: var(--green);
}


.delta.bad {
    color: var(--red);
}


.delta.flat {
    color: var(--muted);
}


.analytics-box {
    margin-top: 12px;

    padding: 18px;

    border:
        1px solid
        var(--border);

    border-radius: 20px;

    background:
        var(--surface);
}


.chart-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    flex-wrap: wrap;

    margin-bottom: 18px;
}


.selector {
    display: flex;

    gap: 6px;

    flex-wrap: wrap;
}


.chip {
    padding: 6px 10px;

    border-radius: 999px;

    border:
        1px solid
        rgba(220,184,100,.10);

    background:
        rgba(255,255,255,.02);

    color: var(--muted);

    font-size: 9px;

    cursor: pointer;
}


.chip.active {
    border-color:
        rgba(220,184,100,.23);

    background:
        var(--gold-soft);

    color:
        var(--gold-light);
}


.chart {
    width: 100%;
    height: 190px;

    display: block;
}


.chart-grid {
    stroke:
        rgba(255,255,255,.045);

    stroke-width: 1;
}


.chart-line {
    fill: none;

    stroke:
        var(--gold-light);

    stroke-width: 2;

    stroke-linecap: round;

    stroke-linejoin: round;
}


.chart-area {
    fill:
        rgba(202,168,93,.055);
}


.chart-dot {
    fill:
        var(--gold-light);

    stroke: #080808;

    stroke-width: 2;
}


.chart-empty {
    padding: 55px 10px;

    text-align: center;

    color: var(--muted);

    font-size: 11px;
}


.status {
    width: fit-content;

    margin-bottom: 11px;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 9px;
}


.status.active {
    color:
        var(--gold-light);

    background:
        var(--gold-soft);
}


.status.positive {
    color:
        var(--green);

    background:
        var(--green-soft);
}


.status.negative {
    color:
        var(--red);

    background:
        var(--red-soft);
}


.status.neutral {
    color:
        var(--muted);

    background:
        rgba(255,255,255,.04);
}


.experiment-card {
    padding: 19px;

    margin-bottom: 11px;

    border:
        1px solid
        var(--border);

    border-radius:
        var(--radius);

    background:
        var(--surface);
}


.compare {
    display: grid;

    grid-template-columns:
        1.2fr
        1fr
        1fr;

    gap: 7px;

    margin-top: 17px;
}


.compare-cell {
    padding: 10px;

    border-radius: 11px;

    background:
        rgba(255,255,255,.022);

    color: var(--muted);

    font-size: 9px;
}


.compare-value {
    display: block;

    margin-top: 4px;

    color: var(--text);

    font-size: 13px;

    font-weight: 620;
}


.compare-head {
    color:
        var(--gold-light);
}


.action {
    width: 100%;

    margin-top: 16px;

    padding: 12px 16px;

    border:
        1px solid
        rgba(220,184,100,.25);

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(202,168,93,.16),
            rgba(202,168,93,.06)
        );

    color:
        var(--gold-light);

    font-size: 11px;

    font-weight: 600;

    cursor: pointer;
}


.modal-wrap {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: flex-end;
    justify-content: center;

    padding: 18px;

    background:
        rgba(0,0,0,.76);

    backdrop-filter:
        blur(10px);
}


.modal-wrap.open {
    display: flex;
}


.modal {
    width: 100%;
    max-width: 520px;

    padding: 22px;

    border-radius: 23px;

    border:
        1px solid
        rgba(220,184,100,.20);

    background:
        linear-gradient(
            150deg,
            rgba(31,28,22,.98),
            rgba(9,9,9,.99)
        );

    box-shadow:
        0 -20px 70px
        rgba(0,0,0,.60);
}


.modal-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}


.modal-title {
    font-size: 19px;

    font-weight: 580;
}


.modal-close {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    border:
        1px solid
        rgba(255,255,255,.06);

    background:
        rgba(255,255,255,.035);

    color:
        var(--muted);

    cursor: pointer;
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2,1fr);

    gap: 10px;
}


.field {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


.field.full {
    grid-column:
        1 / -1;
}


.field label {
    color:
        var(--muted);

    font-size: 9px;

    text-transform:
        uppercase;

    letter-spacing:
        .13em;
}


.field input,
.field textarea {
    width: 100%;

    padding: 13px 14px;

    border-radius: 12px;

    border:
        1px solid
        rgba(255,255,255,.06);

    outline: none;

    background:
        rgba(255,255,255,.035);

    color: var(--text);

    font-size: 14px;
}


.field textarea {
    min-height: 100px;

    resize: vertical;
}


.field input:focus,
.field textarea:focus {
    border-color:
        rgba(220,184,100,.35);
}


.hint {
    margin-top: 12px;

    padding: 11px 12px;

    border-radius: 11px;

    background:
        var(--gold-soft);

    color:
        var(--gold-light);

    font-size: 10px;

    line-height: 1.5;
}


.save-button {
    width: 100%;

    margin-top: 16px;

    padding: 14px;

    border: 0;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #d8ba74,
            #a98642
        );

    color: #0a0805;

    font-size: 12px;

    font-weight: 750;

    cursor: pointer;
}


.save-button:disabled {
    opacity: .6;
}


.form-error {
    display: none;

    margin-top: 12px;

    padding: 10px 12px;

    border-radius: 10px;

    background:
        var(--red-soft);

    color: var(--red);

    font-size: 10px;
}


.empty {
    padding: 28px;

    text-align: center;

    color:
        var(--muted);

    font-size: 11px;

    border:
        1px dashed
        var(--border);

    border-radius:
        var(--radius);
}


.loading {
    padding: 60px 20px;

    text-align: center;

    color:
        var(--muted);

    font-size: 11px;
}


.error {
    padding: 17px;

    border:
        1px solid
        rgba(231,119,119,.15);

    border-radius: 15px;

    background:
        rgba(231,119,119,.06);

    color: #ed8989;

    font-size: 11px;
}


.bottom {
    position: fixed;

    left: 50%;
    bottom: 0;

    transform:
        translateX(-50%);

    z-index: 100;

    width: 100%;
    max-width: 800px;

    display: grid;

    grid-template-columns:
        repeat(4,1fr);

    padding:
        10px
        18px
        14px;

    border-top:
        1px solid
        var(--border);

    background:
        rgba(5,5,5,.93);

    backdrop-filter:
        blur(28px);
}


.nav {
    border: 0;

    background: none;

    color:
        var(--muted);

    font-size: 9px;

    cursor: pointer;
}


.nav-symbol {
    display: block;

    margin-bottom: 4px;

    font-size: 18px;
}


.nav.active {
    color:
        var(--gold-light);
}


@media (
    max-width: 640px
) {

    .app {
        padding:
            22px
            14px
            105px;
    }


    .summary {
        grid-template-columns:
            repeat(2,1fr);
    }


    .metric-grid {
        grid-template-columns:
            repeat(2,1fr);
    }


    .action-row,
    .page-actions {
        grid-template-columns:
            1fr;
    }


    .compare {
        grid-template-columns:
            1fr
            .9fr
            .9fr;
    }


    .brand-main {
        font-size: 15px;
    }


    .brand-sub {
        font-size: 8px;
    }
}

/* =========================================================
   NEW SIDEBAR LAYOUT
========================================================= */

.shell {
    width: 100%;
    min-height: 100vh;

    display: flex;
}


.sidebar {
    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    z-index: 200;

    width: 235px;

    display: flex;

    flex-direction: column;

    padding: 28px 17px 18px;

    border-right:
        1px solid
        rgba(202,168,93,.12);

    background:
        rgba(6,6,6,.96);

    backdrop-filter:
        blur(28px);
}


.sidebar-brand {
    padding: 0 13px 27px;

    display: flex;

    align-items: baseline;

    gap: 10px;
}


.sidebar-nav {
    display: flex;

    flex-direction: column;

    gap: 5px;

    flex: 1;
}


.side-item {
    width: 100%;

    min-height: 46px;

    display: flex;

    align-items: center;

    gap: 13px;

    padding: 0 14px;

    border: 1px solid transparent;

    border-radius: 12px;

    background: transparent;

    color: var(--muted);

    text-align: left;

    font-size: 12px;

    cursor: pointer;

    transition:
        background .18s,
        color .18s,
        border-color .18s;
}


.side-item:hover {
    background:
        rgba(255,255,255,.025);

    color: var(--text);
}


.side-item.active {
    border-color:
        rgba(202,168,93,.20);

    background:
        linear-gradient(
            135deg,
            rgba(202,168,93,.13),
            rgba(202,168,93,.035)
        );

    color: var(--gold-light);
}


.side-icon {
    width: 22px;

    text-align: center;

    font-size: 17px;

    color: inherit;
}


.side-divider {
    height: 1px;

    margin: 12px 8px;

    background:
        rgba(202,168,93,.10);
}


.sidebar-footer {
    display: flex;

    align-items: center;

    gap: 11px;

    padding:
        15px
        10px
        4px;

    border-top:
        1px solid
        rgba(202,168,93,.09);
}


.sidebar-avatar {
    width: 34px;
    height: 34px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    border:
        1px solid
        rgba(202,168,93,.22);

    background:
        rgba(202,168,93,.06);

    color: var(--gold-light);

    font-size: 12px;
}


.sidebar-user-name {
    max-width: 130px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: var(--text);

    font-size: 11px;
}


.sidebar-user-status {
    margin-top: 3px;

    color: var(--muted);

    font-size: 8px;
}


.main-area {
    width:
        calc(
            100% - 235px
        );

    min-height: 100vh;

    margin-left: 235px;
}


.app {
    width: 100%;

    max-width: 1050px;

    margin: 0 auto;

    padding:
        48px
        34px
        70px;
}


/*
    Старое нижнее меню
    полностью скрываем.
*/

.bottom {
    display: none !important;
}


.mobile-topbar {
    display: none;
}


.burger {
    border: 0;

    background: none;

    color: var(--text);

    font-size: 22px;

    cursor: pointer;
}


.mobile-brand {
    display: flex;

    align-items: baseline;

    gap: 8px;

    font-size: 13px;

    font-weight: 650;

    letter-spacing: .12em;
}


.mobile-brand small {
    color: var(--gold-light);

    font-size: 7px;

    letter-spacing: .22em;
}


.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 190;

    background:
        rgba(0,0,0,.62);

    backdrop-filter:
        blur(5px);
}


/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (
    max-width: 760px
) {

    .sidebar {
        width: 235px;

        transform:
            translateX(-100%);

        transition:
            transform .23s ease;
    }


    .sidebar.open {
        transform:
            translateX(0);
    }


    .sidebar-overlay.open {
        display: block;
    }


    .main-area {
        width: 100%;

        margin-left: 0;
    }


    .mobile-topbar {
        position: sticky;

        top: 0;

        z-index: 100;

        height: 59px;

        display: flex;

        align-items: center;

        justify-content: space-between;

        padding: 0 15px;

        border-bottom:
            1px solid
            rgba(202,168,93,.10);

        background:
            rgba(5,5,5,.93);

        backdrop-filter:
            blur(22px);
    }


    .app {
        padding:
            25px
            14px
            55px;
    }

}