:root {
    color-scheme: light;
    --bg: #eef2f1;
    --ink: #14171f;
    --muted: #6b7280;
    --line: rgba(28, 37, 46, 0.12);
    --panel: rgba(255, 255, 255, 0.82);
    --panel-solid: #ffffff;
    --brand: #0d7c66;
    --brand-dark: #075d4b;
    --accent: #e2553f;
    --blue: #2c6bed;
    --gold: #d49322;
    --soft: #e7f5f0;
    --danger: #b42318;
    --shadow: 0 22px 70px rgba(25, 31, 39, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(13, 124, 102, 0.16), transparent 34%),
        linear-gradient(315deg, rgba(226, 85, 63, 0.14), transparent 30%),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.45;
    background-image:
        linear-gradient(rgba(20, 23, 31, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 23, 31, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.pageShell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(16px, 5vw, 56px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(246, 248, 247, 0.76);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
    font-size: 1.12rem;
    letter-spacing: 0;
}

.brand span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    box-shadow: 0 10px 24px rgba(20, 23, 31, 0.18);
}

.topbar nav a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    padding: 0 14px;
    color: var(--ink);
    font-weight: 800;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: stretch;
    gap: 20px;
    padding: 34px 0 18px;
    animation: rise 0.55s ease both;
}

.hero.compact {
    grid-template-columns: 1fr;
    padding-bottom: 12px;
}

.hero h1 {
    max-width: 850px;
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.hero p {
    max-width: 700px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.eyebrow {
    margin: 0 0 10px !important;
    color: var(--accent) !important;
    font-size: 0.78rem !important;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.heroBox {
    position: relative;
    display: flex;
    min-height: 190px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(231, 245, 240, 0.82));
    box-shadow: var(--shadow);
}

.heroBox::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -42px;
    width: 130px;
    height: 130px;
    border: 24px solid rgba(13, 124, 102, 0.12);
    border-radius: 50%;
}

.heroBox span,
.heroBox small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.heroBox strong {
    color: var(--brand);
    font-size: 4.3rem;
    line-height: 1;
}

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

.statTile {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 16px 46px rgba(25, 31, 39, 0.08);
    padding: 18px;
    animation: rise 0.55s ease both;
}

.statTile::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--brand);
}

.statTile.accent::before {
    background: var(--accent);
}

.statTile.warn::before {
    background: var(--gold);
}

.statTile.blue::before {
    background: var(--blue);
}

.statTile span,
.statTile small {
    color: var(--muted);
    font-weight: 800;
}

.statTile strong {
    display: block;
    margin: 9px 0 2px;
    font-size: 2.3rem;
    line-height: 1;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.two {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.panel,
.linkCard {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel {
    margin-top: 18px;
    padding: 22px;
    animation: rise 0.55s ease both;
}

.panel.narrow {
    width: min(520px, 100%);
    margin: 52px auto;
}

.authPanel h1 {
    margin-top: 0;
    font-size: 2rem;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

h2 {
    margin: 0 0 16px;
    font-size: 1.16rem;
}

h3 {
    margin: 0 0 12px;
    font-size: 0.92rem;
    color: #383f4b;
}

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

label {
    display: grid;
    gap: 7px;
    color: #303641;
    font-size: 0.92rem;
    font-weight: 800;
}

label small {
    color: var(--muted);
    font-weight: 600;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.14);
    transform: translateY(-1px);
}

button {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), #0a9b78);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 10px 15px;
    box-shadow: 0 14px 28px rgba(13, 124, 102, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    filter: saturate(1.1);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(13, 124, 102, 0.28);
}

button.danger {
    min-height: 36px;
    background: linear-gradient(135deg, var(--danger), #e2553f);
    font-size: 0.86rem;
    box-shadow: 0 10px 20px rgba(180, 35, 24, 0.18);
}

.notice {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
    animation: pop 0.25s ease both;
}

.notice.success {
    background: var(--soft);
    color: var(--brand-dark);
}

.notice.error {
    background: #ffe8e4;
    color: var(--danger);
}

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

code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
    padding: 2px 6px;
}

.tableWrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 820px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: rgba(13, 124, 102, 0.05);
}

.truncate {
    max-width: 280px;
    overflow-wrap: anywhere;
}

.miniMetric {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    background: rgba(13, 124, 102, 0.1);
    color: var(--brand-dark);
    padding: 4px 10px;
    font-weight: 900;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.linkCard {
    padding: 20px;
    animation: rise 0.55s ease both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.linkCard:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 80px rgba(25, 31, 39, 0.16);
}

.cardHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cardHead h2 {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.cardHead strong {
    display: grid;
    min-width: 84px;
    color: var(--brand);
    font-size: 2.45rem;
    line-height: 1;
    text-align: right;
}

.cardHead strong span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.destination {
    margin: 18px 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.kpiRow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.kpiRow div {
    min-height: 82px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
    padding: 12px;
}

.kpiRow span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.kpiRow strong {
    display: block;
    margin-top: 6px;
    font-size: 1.65rem;
}

.ratioBar {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(180, 35, 24, 0.12);
}

.ratioBar i,
.ratioBar b {
    display: block;
    min-width: 0;
    animation: grow 0.8s ease both;
}

.ratioBar i {
    background: linear-gradient(90deg, var(--brand), #4cc39c);
}

.ratioBar b {
    background: linear-gradient(90deg, var(--gold), var(--accent));
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.metrics span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    padding: 6px 10px;
    color: #474b55;
    font-size: 0.84rem;
    font-weight: 800;
}

.chartBlock,
.recentBlock {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.countryBar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.countryBar span,
.countryBar strong {
    font-weight: 900;
}

.countryBar div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(20, 23, 31, 0.08);
}

.countryBar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--brand));
    animation: grow 0.8s ease both;
}

.recentBlock ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recentBlock li {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    padding: 7px 10px;
}

.recentBlock li span {
    font-weight: 900;
}

.recentBlock li b {
    justify-self: start;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.76rem;
}

.recentBlock li b.good {
    background: rgba(13, 124, 102, 0.12);
    color: var(--brand-dark);
}

.recentBlock li b.bad {
    background: rgba(180, 35, 24, 0.12);
    color: var(--danger);
}

.recentBlock time {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes grow {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }

    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

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

    .hero > div:first-child,
    .grid.two > .formPanel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    main {
        width: min(100% - 24px, 1180px);
        padding-top: 20px;
    }

    .hero,
    .grid.two,
    .statGrid,
    .kpiRow {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.35rem;
    }

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

    .cardHead {
        display: grid;
    }

    .cardHead strong {
        text-align: left;
    }

    .recentBlock li {
        grid-template-columns: 38px 1fr;
    }

    .recentBlock time {
        grid-column: 1 / -1;
    }
}
