:root {
    font-family: "Segoe UI Variable","Segoe UI",Inter,system-ui,sans-serif;
    color: #15213b;
    background: #edf4ff;
    font-size: 14px;
    --primary: #386bfa;
    --muted: #71809b;
    --line: #e1eaf6
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: linear-gradient(135deg,#f5f9ff,#e8f1ff);
    min-height: 100vh
}

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

button, .button {
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #15213b;
    padding: 11px 17px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px
}

    button:hover, .button:hover {
        background: #e1ecff
    }

    button:disabled {
        opacity: .45;
        cursor: wait
    }

.primary {
    color: #fff !important;
    border-color: transparent;
    background: linear-gradient(130deg,#3b9aff,#386bfa) !important;
    box-shadow: 0 4px 12px #386bfa25
}

.danger {
    color: #eb5362;
    background: #fff1f3
}

.quiet {
    background: transparent;
    border: 0
}

.app-shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 236px;
    flex-shrink: 0;
    background: #f6faffdf;
    backdrop-filter: blur(12px);
    border-right: 1px solid #e1eaf6;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 15px
}

.brand {
    font-size: 22px;
    font-weight: 750;
    color: #15213b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    white-space: nowrap
}

    .brand small {
        font-size: 11px;
        font-weight: 500;
        color: var(--muted)
    }

.brand-mark {
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg,#19c4e3,#386bfa,#8c6ff6);
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 34px;
    font-size: 26px
}

.brand-logo { display: block; width: 170px; height: 42px; object-fit: contain; object-position: left center; }
.brand-product { display: inline-block; align-self: flex-end; margin: 0 0 8px -6px; color: #386bfa; font-size: 10px; font-weight: 650; }

.sidebar nav {
    display: grid;
    gap: 5px;
    overflow: auto
}

    .sidebar nav a {
        color: #364967;
        padding: 11px 13px;
        border-radius: 10px;
        display: flex;
        gap: 12px;
        align-items: center
    }

        .sidebar nav a span {
            width: 20px;
            text-align: center;
            font-size: 18px
        }

        .sidebar nav a.active {
            background: linear-gradient(120deg,#dfecff,#bad7ff);
            color: #2858e7;
            font-weight: 600;
            box-shadow: inset 0 0 0 1px #c5ddff
        }

.sidebar-foot {
    margin-top: auto;
    padding: 18px 12px;
    color: #597199;
    font-size: 12px;
    line-height: 1.9
}

.status-dot {
    display: inline-block;
    border-radius: 50%;
    width: 7px;
    height: 7px;
    background: #16a36a;
    margin-right: 5px
}

.main-column {
    min-width: 0;
    flex: 1
}

.topbar {
    height: 65px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    background: #ffffff99;
    border-bottom: 1px solid #e1eaf6;
    backdrop-filter: blur(12px)
}

    .topbar > span:first-child {
        flex: 1;
        color: var(--muted)
    }

    .topbar form {
        margin: 0
    }

main {
    padding: 28px;
    max-width: 1660px;
    margin: auto
}

h1 {
    font-size: 27px;
    line-height: 1.25;
    margin: 0 0 7px;
    font-weight: 650
}

h2 {
    font-size: 18px;
    margin: 0 0 18px;
    font-weight: 650
}

h3 {
    font-size: 16px;
    margin: 0 0 12px
}

p {
    line-height: 1.6
}

.muted, .subtitle {
    color: var(--muted)
}

.subtitle {
    margin: 0 0 24px
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px
}

.card {
    padding: 22px;
    background: #ffffffed;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 8px 28px #254b8412;
    margin-bottom: 20px
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
    gap: 16px;
    margin-bottom: 20px
}

.metric {
    font-size: 28px;
    font-weight: 650;
    margin: 12px 0 2px
}

.metric-icon {
    color: var(--primary);
    background: #e1ecff;
    border-radius: 12px;
    display: inline-block;
    padding: 9px 12px
}

.metric-label {
    color: var(--muted);
    font-size: 13px
}

.split {
    display: grid;
    grid-template-columns: minmax(0,1.4fr) minmax(300px,1fr);
    gap: 20px
}

.scope-bar {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 25px
}

.dashboard-period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.period-switch { display: inline-flex; gap: 4px; padding: 4px; background: #f2f6fc; border-radius: 10px; }
.period-switch button { min-height: 36px; padding: 7px 14px; border-color: transparent; background: transparent; color: #455875; border-radius: 8px; }
.period-switch button.active { color: #2458d9; background: #fff; border-color: #dce7f8; box-shadow: 0 1px 3px #15213b12; font-weight: 600; }
.period-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period-range label { margin: 0; }
.period-range input { min-width: 150px; }
.terminal-list { display: grid; gap: 10px; }
.terminal-item { padding: 16px; background: #f8faff; border: 1px solid var(--line); border-radius: 10px; }
.terminal-item h3 { margin: 0 0 7px; font-size: 16px; }
.terminal-item p { margin: 0; color: #597199; }
.terminal-item-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.terminal-details { display: grid; grid-template-columns: minmax(170px, auto) 1fr; gap: 7px 12px; margin: 12px 0 0; font-size: 12px; }
.terminal-details dt { color: var(--muted); } .terminal-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .terminal-item-main { align-items: flex-start; flex-direction: column; } .dashboard-period { align-items: stretch; } .period-switch { display: grid; grid-template-columns: 1fr 1fr; } .period-range { align-items: stretch; } .period-range label, .period-range button { flex: 1 1 100%; } }

    .scope-bar label {
        flex: 1;
        min-width: 180px
    }

    .scope-bar button {
        margin-bottom: 0
    }

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    color: #597199;
    margin-bottom: 15px
}

input, select, textarea {
    font: inherit;
    min-height: 42px;
    width: 100%;
    border: 1px solid #dce8f8;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fbff;
    color: #15213b
}

textarea {
    min-height: 100px;
    resize: vertical
}

input[type=checkbox] {
    width: 18px;
    min-height: 18px
}

label.check {
    flex-direction: row;
    align-items: center;
    gap: 10px
}

input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid #2858e7;
    outline-offset: 3px
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0 16px
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 12px
}

.toolbar {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left
}

th {
    font-size: 12px;
    color: #71809b;
    font-weight: 500;
    background: #f6faff
}

td, th {
    padding: 13px 12px;
    border-bottom: 1px solid #edf3fb
}

td {
    font-size: 13px
}

    td small {
        display: block;
        color: var(--muted);
        margin-top: 4px
    }

.badge {
    border-radius: 9px;
    padding: 4px 9px;
    background: #e1f7eb;
    color: #168152;
    font-size: 11px;
    white-space: nowrap
}

    .badge.inactive {
        color: #b97700;
        background: #fff3dc
    }

.empty {
    text-align: center;
    padding: 45px 20px;
    color: var(--muted)
}

.notice {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #d8e7ff;
    background: #edf5ff;
    margin: 14px 0;
    line-height: 1.6
}

    .notice.error {
        background: #fff1f3;
        border-color: #ffd3db;
        color: #a92e40
    }

    .notice.success {
        background: #e1f7eb;
        border-color: #a9e6cd;
        color: #15734e
    }

.login-card {
    max-width: 470px;
    margin: 45px auto;
    padding: 35px;
    background: #ffffffeb;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 12px 40px #386bfa12
}

    .login-card button {
        width: 100%;
        margin-top: 10px
    }

    .login-card p {
        color: var(--muted)
    }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(190px,1fr));
    gap: 16px
}

.service-card {
    border-radius: 17px;
    background: #fff;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px #254b840c
}

    .service-card img {
        display: block;
        width: 100%;
        height: 130px;
        object-fit: cover;
        background: linear-gradient(120deg,#dfecff,#f4f8ff)
    }

.service-info {
    padding: 15px
}

    .service-info strong {
        display: block;
        margin-bottom: 8px
    }

    .service-info .price {
        font-size: 18px;
        font-weight: 650;
        color: var(--primary)
    }

    .service-info button {
        float: right;
        padding: 4px 10px;
        min-height: 32px
    }

.wide {
    grid-column: 1/-1
}

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

    .inline input, .inline select {
        min-width: 0
    }

.code {
    font-family: Consolas,monospace;
    word-break: break-all;
    font-size: 12px
}

.operation {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    margin: 10px 0
}

.placeholder-chart {
    height: 160px;
    border-radius: 12px;
    background: repeating-linear-gradient(0deg,transparent,transparent 38px,#edf3fb 39px,#edf3fb 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted)
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff3dc;
    padding: 16px;
    z-index: 100
}

details summary {
    cursor: pointer;
    color: var(--primary)
}

.timezone-picker summary { padding: 12px; border: 1px solid #dce8f8; border-radius: 10px; }
.timezone-list { height: 228px; overflow-y: auto; }
.timezone-option { display: block; width: 100%; height: 38px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media(max-width:1100px) {
    .sidebar {
        width: 205px;
        padding: 18px 10px
    }

    main {
        padding: 20px
    }

    .split {
        grid-template-columns: 1fr
    }

    .topbar {
        padding: 0 20px
    }
}

@media(max-width:760px) {
    .app-shell {
        display: block
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 14px
    }

    .brand {
        margin-bottom: 12px
    }

    .sidebar nav {
        display: flex;
        overflow-x: auto
    }

        .sidebar nav a {
            white-space: nowrap
        }

    .sidebar-foot {
        display: none
    }

    .topbar {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        padding: 12px 18px
    }

        .topbar > span:first-child {
            display: none
        }

    main {
        padding: 18px
    }

    .form-grid {
        grid-template-columns: 1fr
    }

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

    .table-wrap {
        max-width: calc(100vw - 80px)
    }

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

    .card {
        padding: 18px
    }

    .login-card {
        margin: 20px auto;
        padding: 24px
    }

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

@media(prefers-reduced-motion:reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important
    }
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.auth-content {
    width: 100%;
    max-width: 470px;
    padding: 0;
    margin: 0
}

    .auth-content .login-card {
        width: 100%;
        margin: 0
    }

@media(max-width:480px) {
    .auth-shell {
        padding: 16px
    }

    .auth-content .login-card {
        padding: 24px
    }
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .sidebar nav a .office-icon {
        width: 19px;
        height: 19px;
        min-width: 19px;
        flex-shrink: 0;
        color: currentColor;
    }

    .sidebar nav a.active .office-icon {
        stroke-width: 2;
    }
.variant-table { width: 100%; max-width: 680px; }
.variant-table th, .variant-table td { padding: 4px 6px; }
.variant-table input { width: 100%; min-width: 0; }
.variant-table th:last-child, .variant-table td:last-child { width: 50px; }
.variant-table td:last-child button { min-width: 40px; padding: 8px; }
.variant-action-heading { font-size: 0; }
