@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap");

:root {
    color-scheme: dark;
}

body.hpcairo-stats-template {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(182, 126, 63, 0.16), transparent 32rem),
        radial-gradient(circle at 92% 18%, rgba(127, 76, 38, 0.12), transparent 30rem),
        #0c0907;
    color: #f8eedf;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

body.hpcairo-stats-template * {
    box-sizing: border-box;
}

body.hpcairo-stats-template a {
    color: inherit;
}

.hpc-stats {
    --stats-bg: #0c0907;
    --stats-panel: rgba(24, 17, 13, 0.88);
    --stats-panel-strong: #18110d;
    --stats-line: rgba(223, 177, 104, 0.2);
    --stats-line-strong: rgba(234, 196, 132, 0.44);
    --stats-text: #f8eedf;
    --stats-muted: rgba(248, 238, 223, 0.62);
    --stats-gold: #d9a75b;
    --stats-gold-light: #f1cf8b;
    --stats-site: #e2b666;
    --stats-yandex: #d97c59;
    min-height: 100vh;
    padding: 20px clamp(14px, 2.5vw, 36px) 30px;
}

.hpc-stats::before {
    position: fixed;
    inset: 15px;
    z-index: -1;
    border: 1px solid rgba(217, 167, 91, 0.12);
    pointer-events: none;
    content: "";
}

.hpc-stats__eyebrow {
    margin: 0 0 9px;
    color: var(--stats-gold-light);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.25em;
}

.hpc-stats-login {
    width: min(100%, 470px);
    margin: max(7vh, 46px) auto 0;
    padding: clamp(36px, 7vw, 64px);
    border: 1px solid var(--stats-line);
    background: linear-gradient(150deg, rgba(29, 20, 15, 0.98), rgba(14, 10, 8, 0.98));
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
    text-align: center;
}

.hpc-stats-logo {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.hpc-stats-logo.is-login {
    width: 112px;
    height: 112px;
    margin: -9px auto 19px;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.35));
}

.hpc-stats-login h1,
.hpc-stats-header h1,
.hpc-stats-section-heading h2,
.hpc-stats-empty h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
}

.hpc-stats-login h1 {
    margin: 0;
    font-size: clamp(42px, 9vw, 62px);
    line-height: 1;
}

.hpc-stats-login__text {
    max-width: 340px;
    margin: 20px auto 29px;
    color: var(--stats-muted);
    font-size: 14px;
    line-height: 1.65;
}

.hpc-stats-login__form {
    display: grid;
    gap: 11px;
}

.hpc-stats-login__form label {
    text-align: left;
    color: var(--stats-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hpc-stats-login__form input {
    width: 100%;
    height: 62px;
    border: 1px solid var(--stats-line-strong);
    border-radius: 0;
    outline: none;
    background: rgba(7, 5, 4, 0.74);
    color: var(--stats-text);
    font: 700 27px/1 "Montserrat", sans-serif;
    letter-spacing: 0.35em;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hpc-stats-login__form input:focus {
    border-color: var(--stats-gold-light);
    box-shadow: 0 0 0 3px rgba(217, 167, 91, 0.12);
}

.hpc-stats-login__form button {
    min-height: 56px;
    margin-top: 4px;
    border: 1px solid rgba(248, 221, 166, 0.72);
    background: linear-gradient(135deg, #f0ce89, #d49c4e 52%, #9d602f);
    color: #170f0a;
    font: 700 13px/1 "Montserrat", sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.hpc-stats-login__form button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.hpc-stats-login__error {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(225, 103, 77, 0.36);
    background: rgba(159, 52, 36, 0.15);
    color: #ffc2b5;
    font-size: 12px;
    line-height: 1.45;
}

.hpc-stats-login__back {
    display: inline-block;
    margin-top: 24px;
    color: var(--stats-muted) !important;
    font-size: 12px;
    text-decoration: none;
}

.hpc-stats-shell {
    width: min(100%, 1320px);
    margin: 0 auto;
}

.hpc-stats-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--stats-line);
}

.hpc-stats-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hpc-stats-logo.is-header {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
}

.hpc-stats-header h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.03;
}

.hpc-stats-header__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hpc-stats-header__actions > a {
    color: var(--stats-muted);
    font-size: 12px;
    text-decoration: none;
}

.hpc-stats-switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--stats-line);
    background: rgba(0, 0, 0, 0.22);
}

.hpc-stats-switch button {
    min-height: 38px;
    padding: 0 15px;
    border: 0;
    background: transparent;
    color: var(--stats-muted);
    font: 700 11px/1 "Montserrat", sans-serif;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.hpc-stats-switch button.is-active {
    background: linear-gradient(135deg, #e8c47f, #b97a38);
    color: #170f0a;
}

.hpc-stats-summary,
.hpc-stats-trends,
.hpc-stats-history {
    padding-top: 42px;
}

.hpc-stats-summary__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.hpc-stats-summary__heading p {
    margin: 0;
    color: var(--stats-muted);
    font-size: 12px;
}

.hpc-stats-summary__heading h2 {
    margin: 0;
    color: var(--stats-gold-light);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hpc-stats-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.hpc-stats-card {
    position: relative;
    min-height: 215px;
    padding: 23px;
    overflow: hidden;
    border: 1px solid var(--stats-line);
    background: var(--stats-panel);
}

.hpc-stats-card::after {
    position: absolute;
    right: -34px;
    bottom: -60px;
    width: 150px;
    height: 150px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0.08;
    content: "";
}

.hpc-stats-card.is-site {
    color: var(--stats-site);
}

.hpc-stats-card.is-yandex {
    color: var(--stats-yandex);
}

.hpc-stats-card > span {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid currentColor;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hpc-stats-card h3 {
    margin: 17px 0 2px;
    color: var(--stats-text);
    font-size: 13px;
    font-weight: 600;
}

.hpc-stats-card strong {
    display: block;
    color: var(--stats-text);
    font-size: clamp(38px, 4vw, 56px);
    font-weight: 700;
    line-height: 1.08;
}

.hpc-stats-card p,
.hpc-stats-card small {
    display: block;
    position: relative;
    z-index: 1;
    margin: 12px 0 0;
    color: var(--stats-muted);
    font-size: 11px;
    line-height: 1.45;
}

.hpc-stats-card small {
    margin-top: 5px;
}

.hpc-stats-card [data-direction="up"] {
    color: #93c995;
}

.hpc-stats-card [data-direction="down"] {
    color: #e49b87;
}

.hpc-stats-section-heading {
    margin-bottom: 18px;
}

.hpc-stats-section-heading h2 {
    margin: 0;
    font-size: clamp(28px, 3.4vw, 39px);
}

.hpc-stats-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hpc-stats-charts > article {
    min-width: 0;
    padding: 22px 22px 18px;
    border: 1px solid var(--stats-line);
    background: rgba(22, 15, 11, 0.68);
}

.hpc-stats-charts header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hpc-stats-charts header span {
    color: var(--stats-gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hpc-stats-charts h3 {
    margin: 0;
    color: var(--stats-text);
    font-size: 13px;
}

.hpc-stats-chart {
    display: flex;
    align-items: flex-end;
    gap: clamp(5px, 1vw, 10px);
    height: 174px;
    margin-top: 21px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hpc-stats-chart__item {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    align-items: flex-end;
    justify-content: center;
}

.hpc-stats-chart__bar {
    position: relative;
    width: min(100%, 32px);
    min-height: 3px;
    background: linear-gradient(180deg, var(--stats-gold-light), #9f6534);
    transition: height 0.25s ease;
}

.hpc-stats-charts > article:nth-child(n+3) .hpc-stats-chart__bar {
    background: linear-gradient(180deg, #e7a07d, #91482f);
}

.hpc-stats-chart__bar strong {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    color: var(--stats-muted);
    font-size: 9px;
    font-weight: 600;
    transform: translateX(-50%);
}

.hpc-stats-chart__bar span {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    width: 48px;
    overflow: hidden;
    color: rgba(248, 238, 223, 0.44);
    font-size: 8px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
}

.hpc-stats-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--stats-line);
    background: rgba(18, 12, 9, 0.68);
}

.hpc-stats-history table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.hpc-stats-history th,
.hpc-stats-history td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(217, 167, 91, 0.12);
    text-align: left;
    vertical-align: top;
}

.hpc-stats-history th {
    color: var(--stats-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hpc-stats-history td {
    color: rgba(248, 238, 223, 0.88);
    font-size: 12px;
    line-height: 1.45;
}

.hpc-stats-history td strong {
    display: block;
    color: var(--stats-text);
    font-size: 16px;
}

.hpc-stats-history td small {
    color: var(--stats-muted);
}

.hpc-stats-history tr:last-child td {
    border-bottom: 0;
}

.hpc-stats-empty {
    width: min(100%, 620px);
    margin: 12vh auto 0;
    padding: 55px 30px;
    border: 1px solid var(--stats-line);
    background: var(--stats-panel);
    text-align: center;
}

.hpc-stats-empty > span {
    color: var(--stats-gold-light);
    font-size: 38px;
}

.hpc-stats-empty h2 {
    margin: 16px 0 9px;
    font-size: 38px;
}

.hpc-stats-empty p {
    margin: 0;
    color: var(--stats-muted);
    font-size: 13px;
    line-height: 1.6;
}

.hpc-stats-matrix-section {
    padding-top: 14px;
}

.hpc-stats-matrix-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.hpc-stats-matrix-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 3.4vw, 40px);
    font-weight: 400;
}

.hpc-stats-matrix-heading > p {
    max-width: 350px;
    margin: 0 0 4px;
    color: var(--stats-muted);
    font-size: 11px;
    line-height: 1.55;
    text-align: right;
}

.hpc-stats-matrix-wrap {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--stats-line);
    background: rgba(17, 12, 9, 0.86);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.hpc-stats-matrix {
    width: auto;
    min-width: 0;
    border-collapse: collapse;
}

.hpc-stats-matrix th,
.hpc-stats-matrix td {
    width: 118px;
    min-width: 118px;
    padding: 6px 10px;
    border-right: 1px solid rgba(217, 167, 91, 0.1);
    border-bottom: 1px solid rgba(217, 167, 91, 0.1);
    text-align: center;
    vertical-align: middle;
}

.hpc-stats-matrix th:last-child,
.hpc-stats-matrix td:last-child {
    border-right: 0;
}

.hpc-stats-matrix thead th {
    height: 42px;
    background: #17100c;
    color: rgba(248, 238, 223, 0.72);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.hpc-stats-matrix .hpc-stats-matrix__metric-head,
.hpc-stats-matrix .hpc-stats-matrix__label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    text-align: left;
}

.hpc-stats-matrix .hpc-stats-matrix__metric-head {
    z-index: 4;
}

.hpc-stats-matrix .hpc-stats-matrix__group {
    position: static;
    padding: 8px 11px;
    border-top: 1px solid var(--stats-line-strong);
    background: #21170f;
    color: var(--stats-gold-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-align: left;
    text-transform: uppercase;
}

.hpc-stats-matrix .hpc-stats-matrix__group.is-yandex {
    color: #e7a07d;
}

.hpc-stats-matrix__label {
    background: #130e0b;
    color: rgba(248, 238, 223, 0.86);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}

.hpc-stats-matrix td {
    background: rgba(22, 15, 11, 0.55);
}

.hpc-stats-matrix .is-current {
    background: rgba(190, 127, 58, 0.12);
}

.hpc-stats-matrix td strong {
    display: block;
    color: var(--stats-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.hpc-stats-matrix td small {
    display: block;
    min-height: 14px;
    margin-top: 4px;
    color: var(--stats-muted);
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
}

.hpc-stats-matrix td small.is-up {
    color: #8ecb91;
}

.hpc-stats-matrix td small.is-down {
    color: #e79682;
}

.hpc-stats-matrix td small.is-first {
    opacity: 0.55;
}

@media (max-width: 1000px) {
    .hpc-stats-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .hpc-stats {
        padding: 14px 10px 24px;
    }

    .hpc-stats::before {
        inset: 7px;
    }

    .hpc-stats-login {
        margin-top: 26px;
        padding: 38px 24px;
    }

    .hpc-stats-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hpc-stats-header__brand {
        align-items: flex-start;
        gap: 14px;
    }

    .hpc-stats-logo.is-header {
        width: 50px;
        height: 50px;
    }

    .hpc-stats-header__actions {
        width: 100%;
        justify-content: space-between;
    }

    .hpc-stats-summary,
    .hpc-stats-trends,
    .hpc-stats-history {
        padding-top: 32px;
    }

    .hpc-stats-summary__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .hpc-stats-cards,
    .hpc-stats-charts {
        grid-template-columns: 1fr;
    }

    .hpc-stats-card {
        min-height: 192px;
    }

    .hpc-stats-matrix-section {
        padding-top: 12px;
    }

    .hpc-stats-matrix-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .hpc-stats-matrix-heading > p {
        max-width: none;
        text-align: left;
    }

    .hpc-stats-matrix .hpc-stats-matrix__metric-head,
    .hpc-stats-matrix .hpc-stats-matrix__label {
        width: 168px;
        min-width: 168px;
        max-width: 168px;
    }

    .hpc-stats-matrix th,
    .hpc-stats-matrix td {
        width: 104px;
        min-width: 104px;
        padding: 6px 8px;
    }

    .hpc-stats-charts > article {
        padding-inline: 16px;
    }
}

@media (max-width: 430px) {
    .hpc-stats-cards {
        gap: 10px;
    }

    .hpc-stats-card {
        min-height: 176px;
        padding: 19px;
    }

    .hpc-stats-switch button {
        padding-inline: 12px;
    }
}
