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

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f7fbff;
    --surface-blue: #eef9ff;

    --text: #585858;
    --text-strong: #2f2f2f;
    --muted: #8a8a8a;
    --muted-light: #a7a7a7;

    --blue: #5FC1FF;
    --blue-hover: #35aef5;
    --blue-deep: #1798dd;
    --blue-soft: #edf9ff;
    --blue-border: #d7efff;

    --green: #62b978;
    --green-soft: #eef9f1;

    --red: #e35a46;
    --red-soft: #fff1ee;

    --orange: #ff7e49;
    --orange-soft: #fff3ed;

    --line: #e8eef3;
    --line-strong: #dce9f1;

    --shadow-card: 0 10px 30px rgba(42, 86, 120, 0.07);
    --shadow-hover: 0 16px 42px rgba(42, 86, 120, 0.10);
    --shadow-soft: 0 6px 18px rgba(42, 86, 120, 0.045);

    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --container: 1360px;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100%;
    margin: 0;
    font-family: "Manrope", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 5% -5%, rgba(95, 193, 255, 0.13), transparent 340px),
        radial-gradient(circle at 100% 0%, rgba(95, 193, 255, 0.08), transparent 420px),
        #ffffff;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

/* Header */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    color: var(--text-strong);
    font-size: 17px;
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.brand-caption {
    margin-top: 5px;
    color: var(--blue-deep);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */

.secondary-button,
.ghost-button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    border: 0;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease;
}

.secondary-button,
.primary-button {
    color: #ffffff;
    background: var(--blue);
    box-shadow: 0 8px 20px rgba(95, 193, 255, 0.24);
}

.secondary-button:hover,
.primary-button:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(95, 193, 255, 0.30);
}

.ghost-button {
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--line);
}

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

.small-button {
    width: 100%;
    min-height: 38px;
}

/* Page */

.page {
    width: min(var(--container), calc(100% - 44px));
    margin: 28px auto 80px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 28px;
    align-items: start;
    margin-bottom: 22px;
}

.hero-main {
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 9px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--blue-deep);
    background: var(--blue-soft);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.hero p {
    margin: 9px 0 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* Period */

.period-box {
    width: 100%;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.period-box label,
.field {
    display: grid;
    gap: 7px;
}

.period-box span,
.field span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

select,
input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    color: var(--text-strong);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 13px;
    font-weight: 700;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

select:focus,
input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(95, 193, 255, 0.16);
}

.custom-period {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.hidden {
    display: none !important;
}

/* Warning */

.warning {
    margin: 0 0 18px;
    padding: 13px 15px;
    color: var(--blue-deep);
    background: var(--blue-soft);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

/* Tabs */

.tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 22px;
    padding: 6px;
    overflow-x: auto;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    scrollbar-width: none;
}

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

.tab-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab-button:hover {
    color: var(--text-strong);
    background: rgba(95, 193, 255, 0.12);
}

.tab-button.is-active,
.tab-button.active {
    color: #ffffff;
    background: var(--blue);
    box-shadow: 0 8px 18px rgba(95, 193, 255, 0.22);
}

.tab-panel {
    margin-top: 0;
}

.tab-panel[hidden] {
    display: none !important;
}

/* Section headers */

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 16px;
}

.section-head h2,
h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.section-head p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.42;
}

/* KPI */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.kpi-card {
    min-height: 156px;
    display: flex;
    flex-direction: column;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--blue-border);
    box-shadow: var(--shadow-hover);
}

.kpi-label {
    min-height: 26px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.kpi-value {
    margin-top: 9px;
    color: var(--text-strong);
    font-size: clamp(21px, 1.9vw, 27px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.kpi-sub {
    margin-top: 9px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
    font-weight: 600;
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: auto;
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-deep);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}
.kpi-card .kpi-delta {
    align-self: flex-start;
}

.kpi-delta.positive {
    color: var(--green);
    background: var(--green-soft);
}

.kpi-delta.negative {
    color: var(--red);
    background: var(--red-soft);
}

/* Tables */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
    font-size: 12.5px;
}

th:first-child,
td:first-child {
    text-align: left;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 9.5px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

td {
    color: var(--text);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: #f9fcff;
}

.empty-cell {
    padding: 22px !important;
    text-align: left !important;
    color: var(--muted);
}

/* Login */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 8%, rgba(95, 193, 255, 0.15), transparent 340px),
        radial-gradient(circle at 82% 92%, rgba(95, 193, 255, 0.10), transparent 360px),
        #ffffff;
}

.login-card {
    width: min(430px, 100%);
    padding: 30px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.brand-login .brand-icon {
    width: 46px;
    height: 46px;
}

.brand-login .brand-name {
    font-size: 21px;
}

.login-title {
    margin-top: 30px;
}

.login-title h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 36px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.login-title p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.form-error {
    padding: 11px 13px;
    color: var(--red);
    background: var(--red-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
}

/* Responsive */

@media (max-width: 1240px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }
}

@media (max-width: 900px) {
    .topbar {
        position: static;
        align-items: stretch;
        flex-direction: column;
        padding: 16px 18px;
    }

    .top-actions {
        width: 100%;
    }

    .secondary-button,
    .ghost-button {
        flex: 1;
    }

    .page {
        width: min(100% - 24px, var(--container));
        margin-top: 22px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .period-box {
        width: 100%;
    }

    .tabs {
        width: 100%;
    }

    .section-head {
        display: block;
    }

    .section-head p {
        margin-top: 7px;
    }

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

    .kpi-card {
        min-height: 142px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .page {
        width: min(100% - 20px, var(--container));
        margin-top: 18px;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 17px;
    }

    .brand-caption {
        font-size: 9px;
    }

    .top-actions {
        flex-direction: column;
    }

    .secondary-button,
    .ghost-button {
        width: 100%;
    }

    .hero h1 {
        font-size: 34px;
    }

    .tabs {
        padding: 5px;
        border-radius: 16px;
    }

    .tab-button {
        min-height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }

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

    .kpi-card {
        min-height: 134px;
    }

    .kpi-label {
        min-height: auto;
    }

    .section-head h2,
    h2 {
        font-size: 23px;
    }

    select,
    input,
    .primary-button {
        height: 44px;
    }

    th,
    td {
        padding: 10px 11px;
        font-size: 12px;
    }

    .login-page {
        padding: 14px;
    }

    .login-card {
        padding: 24px;
        border-radius: 24px;
    }

    .brand-login .brand-icon {
        width: 42px;
        height: 42px;
    }

    .brand-login .brand-name {
        font-size: 19px;
    }

    .login-title {
        margin-top: 26px;
    }

    .login-title h1 {
        font-size: 34px;
    }

    .login-title p {
        font-size: 13px;
    }
}