:root {
    --bg: #f4f8fc;
    --surface: #ffffff;
    --surface-soft: #f7faff;

    --text: #092b50;
    --muted: #6f859b;

    --line: #dce7f1;

    --blue: #0878f9;
    --blue-dark: #0065dc;
    --blue-soft: #eaf4ff;

    --green: #16b989;
    --red: #ec4b64;
    --orange: #f19b38;

    --radius: 10px;
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    background:
        linear-gradient(
            135deg,
            #eff7ff 0%,
            #ffffff 48%,
            #edfdf9 100%
        );

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


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


button,
input,
textarea {
    font: inherit;
}


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


/* BRAND */

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


.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    background: var(--blue);

    color: white;

    font-weight: 800;

    border-radius: 8px;
}


.brand > div:last-child {
    display: flex;
    flex-direction: column;
}


.brand strong {
    font-size: 15px;
}


.brand span {
    color: var(--muted);
    font-size: 12px;
}


/* BUTTONS */

.btn {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 18px;

    border: 1px solid transparent;

    border-radius: 7px;

    cursor: pointer;

    font-weight: 700;

    transition: 160ms ease;
}


.btn.primary {
    background: var(--blue);

    color: white;
}


.btn.primary:hover {
    background: var(--blue-dark);

    transform: translateY(-1px);
}


.btn.secondary {
    background: white;

    color: var(--text);

    border-color: var(--line);
}


.btn.full {
    width: 100%;
}


.btn.big {
    height: 50px;

    margin-top: 8px;
}


/* LOGIN */

.auth-layout {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(380px, 1fr)
        minmax(380px, 560px);
}


.auth-hero {
    min-height: 100vh;

    padding: 52px;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(
            circle at 25% 20%,
            rgba(8, 120, 249, 0.16),
            transparent 34%
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(23, 201, 164, 0.13),
            transparent 36%
        );

    border-right: 1px solid var(--line);
}


.hero-content {
    margin: auto 0;

    max-width: 700px;
}


.eyebrow {
    color: var(--blue);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1.6px;
}


.hero-content h1 {
    margin: 16px 0;

    font-size: clamp(
        42px,
        5vw,
        76px
    );

    line-height: 1.03;

    letter-spacing: -3px;
}


.hero-content p {
    max-width: 540px;

    color: var(--muted);

    font-size: 18px;

    line-height: 1.7;
}


.hero-stats {
    display: flex;
    gap: 44px;
}


.hero-stats div {
    display: flex;
    flex-direction: column;
}


.hero-stats strong {
    font-size: 22px;
}


.hero-stats span {
    margin-top: 3px;

    color: var(--muted);

    font-size: 12px;
}


.auth-form-side {
    min-height: 100vh;

    display: flex;
    align-items: center;

    padding: 50px;
}


.auth-box {
    width: 100%;
}


.auth-box h2 {
    margin:
        10px 0 4px;

    font-size: 34px;

    letter-spacing: -1px;
}


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

    margin-bottom: 32px;
}


/* FORM */

.field {
    margin-bottom: 20px;
}


.field label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;
    font-weight: 700;
}


.field input,
.field textarea {
    width: 100%;

    min-height: 48px;

    padding: 12px 14px;

    background: white;

    color: var(--text);

    border:
        1px solid var(--line);

    border-radius: 7px;

    outline: none;

    transition: 150ms;
}


.field textarea {
    min-height: 110px;

    resize: vertical;
}


.field input:focus,
.field textarea:focus {
    border-color: var(--blue);

    box-shadow:
        0 0 0 3px
        rgba(8, 120, 249, 0.09);
}


.field small {
    display: block;

    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
}


.field-error {
    display: block;

    margin-top: 7px;

    color: var(--red);

    font-size: 12px;
}


.auth-footer {
    margin-top: 24px;

    color: var(--muted);

    font-size: 13px;

    text-align: center;
}


.auth-footer a {
    color: var(--blue);

    font-weight: 700;
}


/* APP */

.app {
    min-height: 100vh;

    display: flex;
}


.sidebar {
    position: fixed;

    inset:
        0 auto 0 0;

    width: 245px;

    padding: 28px 20px;

    display: flex;
    flex-direction: column;

    background:
        rgba(255, 255, 255, 0.93);

    border-right:
        1px solid var(--line);

    backdrop-filter: blur(16px);
}


.nav {
    display: flex;
    flex-direction: column;

    gap: 5px;

    margin-top: 44px;
}


.nav-item {
    min-height: 44px;

    display: flex;
    align-items: center;

    padding: 0 12px;

    color: var(--muted);

    border-radius: 6px;

    font-size: 13px;
    font-weight: 700;
}


.nav-item kbd {
    margin-left: auto;
}


.nav-item:hover,
.nav-item.active {
    background: var(--blue-soft);

    color: var(--blue);
}


kbd {
    min-width: 24px;

    padding: 3px 6px;

    background: white;

    color: var(--muted);

    border: 1px solid var(--line);

    border-radius: 4px;

    font-family: inherit;

    font-size: 10px;

    text-align: center;
}


.keyboard-card {
    margin-top: auto;

    padding: 15px;

    background: var(--surface-soft);

    border: 1px solid var(--line);

    border-radius: 7px;
}


.keyboard-card > span {
    color: var(--muted);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1px;
}


.keyboard-card div {
    margin-top: 10px;

    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 11px;
}


.profile {
    margin-top: 14px;

    padding-top: 15px;

    display: flex;
    align-items: center;

    gap: 10px;

    border-top:
        1px solid var(--line);
}


.avatar {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    background: var(--blue);

    color: white;

    border-radius: 7px;

    font-weight: 800;
}


.profile-info {
    display: flex;
    flex-direction: column;
}


.profile-info strong {
    font-size: 12px;
}


.profile-info a {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


/* CONTENT */

.content {
    width: calc(100% - 245px);

    margin-left: 245px;

    padding: 44px;
}


.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 30px;

    margin-bottom: 34px;
}


.topbar h1 {
    margin:
        7px 0 4px;

    font-size: 38px;

    letter-spacing: -1.5px;
}


.topbar p {
    margin: 0;

    color: var(--muted);
}


/* METRICS */

.metrics {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 18px;
}


.metric {
    min-height: 145px;

    padding: 22px;

    background: white;

    border:
        1px solid var(--line);

    border-radius: var(--radius);
}


.metric > span {
    color: var(--muted);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1px;
}


.metric strong {
    display: block;

    margin-top: 22px;

    font-size: 31px;
}


.metric small {
    color: var(--muted);

    font-size: 13px;
}


.metric-line {
    height: 3px;

    margin-top: 20px;

    background:
        linear-gradient(
            90deg,
            var(--blue),
            #24cba3
        );
}


/* PANEL */

.panel {
    background: white;

    border:
        1px solid var(--line);

    border-radius: var(--radius);
}


.panel-header {
    min-height: 85px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 24px;

    border-bottom:
        1px solid var(--line);
}


.panel-header h2 {
    margin:
        5px 0 0;

    font-size: 21px;
}


.search {
    height: 40px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 12px;

    border:
        1px solid var(--line);

    border-radius: 6px;
}


.search span {
    color: var(--muted);

    font-size: 12px;
}


.search input {
    width: 150px;

    border: 0;
    outline: 0;

    color: var(--text);

    background: transparent;
}


/* BOTS */

.bots-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 14px;

    padding: 18px;
}


.bot-card {
    min-height: 220px;

    padding: 20px;

    border:
        1px solid var(--line);

    border-radius: 8px;

    background: white;

    transition: 160ms;
}


.bot-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 14px 35px
        rgba(27, 74, 118, 0.08);
}


.bot-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.bot-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    background: var(--blue-soft);

    color: var(--blue);

    border-radius: 6px;

    font-size: 11px;
    font-weight: 900;
}


.status {
    display: flex;
    align-items: center;

    gap: 6px;

    padding:
        5px 8px;

    border-radius: 5px;

    color: var(--muted);

    background: var(--surface-soft);

    font-size: 10px;
    font-weight: 800;
}


.status span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--muted);
}


.status.running {
    color: var(--green);

    background:
        rgba(22, 185, 137, 0.08);
}


.status.running span {
    background: var(--green);
}


.status.error {
    color: var(--red);

    background:
        rgba(236, 75, 100, 0.08);
}


.status.error span {
    background: var(--red);
}


.status.building,
.status.cloning {
    color: var(--orange);

    background:
        rgba(241, 155, 56, 0.09);
}


.status.building span,
.status.cloning span {
    background: var(--orange);
}


.bot-card h3 {
    margin:
        22px 0 7px;
}


.repo {
    display: block;

    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.bot-meta {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;

    margin-top: 20px;
}


.bot-meta div {
    padding: 10px;

    background:
        var(--surface-soft);

    border-radius: 5px;
}


.bot-meta span {
    display: block;

    color: var(--muted);

    font-size: 9px;
}


.bot-meta strong {
    display: block;

    margin-top: 4px;

    font-size: 11px;
}


.bot-error {
    margin-top: 12px;

    padding: 9px;

    color: var(--red);

    background:
        rgba(236, 75, 100, 0.06);

    font-size: 10px;

    line-height: 1.5;
}


/* EMPTY */

.empty {
    min-height: 350px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;
}


.empty-symbol {
    width: 54px;
    height: 54px;

    display: grid;
    place-items: center;

    background: var(--blue-soft);

    color: var(--blue);

    border-radius: 7px;

    font-weight: 900;
}


.empty h3 {
    margin:
        18px 0 5px;
}


.empty p {
    max-width: 380px;

    margin:
        0 0 20px;

    color: var(--muted);

    line-height: 1.6;
}


/* DEPLOY */

.deploy-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 760px)
        minmax(250px, 320px);

    gap: 18px;

    align-items: start;
}


.form-panel form {
    padding: 25px;
}


.counter {
    padding:
        7px 10px;

    background: var(--blue-soft);

    color: var(--blue);

    border-radius: 5px;

    font-size: 11px;
    font-weight: 800;
}


.deploy-info {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


.info-block {
    padding: 22px;

    background: white;

    border:
        1px solid var(--line);

    border-radius: var(--radius);
}


.info-block.blue {
    background:
        linear-gradient(
            145deg,
            #edf6ff,
            #f4fffc
        );
}


.info-block h3 {
    margin:
        8px 0 18px;
}


.info-block p {
    color: var(--muted);

    font-size: 12px;

    line-height: 1.7;
}


.info-row {
    display: flex;
    justify-content: space-between;

    padding:
        11px 0;

    border-bottom:
        1px solid var(--line);

    font-size: 12px;
}


.info-row:last-child {
    border-bottom: 0;
}


.info-row span {
    color: var(--muted);
}


/* MESSAGES */

.messages {
    position: fixed;

    top: 20px;
    right: 20px;

    z-index: 1000;

    width: min(
        400px,
        calc(100% - 40px)
    );
}


.message {
    margin-bottom: 8px;

    padding: 13px 15px;

    background: white;

    border:
        1px solid var(--line);

    border-left:
        3px solid var(--blue);

    border-radius: 6px;

    box-shadow:
        0 15px 40px
        rgba(0, 0, 0, 0.08);

    font-size: 12px;
}


.message.success {
    border-left-color: var(--green);
}


.message.error {
    border-left-color: var(--red);
}


/* MOBILE */

@media (max-width: 1100px) {

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


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


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

}


@media (max-width: 760px) {

    .auth-layout {
        display: block;
    }


    .auth-hero {
        display: none;
    }


    .auth-form-side {
        padding: 28px;
    }


    .sidebar {
        display: none;
    }


    .content {
        width: 100%;

        margin: 0;

        padding: 22px;
    }


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


    .metrics,
    .bots-grid {
        grid-template-columns: 1fr;
    }


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

}

.bot-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 18px;

    padding-top: 15px;

    border-top:
        1px solid var(--line);
}


.bot-actions form {
    margin: 0;
}


.action-btn {
    min-height: 31px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 10px;

    background: white;

    color: var(--text);

    border:
        1px solid var(--line);

    border-radius: 5px;

    cursor: pointer;

    font-size: 10px;
    font-weight: 800;

    transition: 150ms;
}


.action-btn:hover {
    color: var(--blue);

    border-color:
        rgba(8, 120, 249, 0.4);

    background: var(--blue-soft);
}


.action-btn.danger:hover {
    color: var(--red);

    border-color:
        rgba(236, 75, 100, 0.35);

    background:
        rgba(236, 75, 100, 0.06);
}


.console {
    min-height: 500px;

    max-height: 70vh;

    margin: 0;

    padding: 22px;

    overflow: auto;

    background: #07121d;

    color: #c5f6e8;

    border-radius:
        0 0 var(--radius) var(--radius);

    font-family:
        "Cascadia Code",
        Consolas,
        monospace;

    font-size: 12px;

    line-height: 1.65;

    white-space: pre-wrap;
    word-break: break-word;
}