.admin-body {
    --bs-body-font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
    --bs-body-bg: #0b1220;
    --bs-body-color: #d6dfef;
    --bs-primary: #3f78dc;
    --bs-border-color: #273247;
    --bs-nav-link-font-size: 0.9rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(63, 120, 220, 0.12) 0, transparent 30%),
        radial-gradient(circle at 0% 100%, rgba(18, 62, 128, 0.18) 0, transparent 28%),
        #0b1220;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.admin-sidebar {
    width: 340px;
    padding: 16px;
}

.admin-sidebar__inner {
    width: 100%;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
    border-radius: 20px;
    border: 1px solid #2a3751;
    background: linear-gradient(155deg, #0f1728 0%, #15213a 100%);
    box-shadow: 0 22px 42px rgba(3, 8, 16, 0.55);
    padding: 18px 14px;
    color: #f2f6ff;
    z-index: 1030;
}

.admin-sidebar__brand {
    padding: 0 12px 0;
    margin-bottom: 10px;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
}

.admin-nav {
    margin-top: 8px;
}

.admin-nav-link {
    border-radius: 12px;
    color: #b8c5df;
    border: 1px solid transparent;
    padding: 10px 12px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.admin-nav-link:hover {
    color: #f3f7ff;
    background: rgba(187, 209, 255, 0.08);
    border-color: rgba(160, 188, 241, 0.24);
}

.admin-nav-link.active,
.admin-nav-link.active:hover {
    color: #f8fbff;
    border-color: rgba(136, 172, 244, 0.4);
    background: linear-gradient(135deg, #2859b8 0%, #3974dd 100%);
}

.admin-nav-link.disabled {
    color: #7582a0;
    cursor: default;
}

.admin-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 72px;
}

.admin-topbar {
    min-height: 72px;
    border-bottom: 1px solid #273247;
    background: rgba(12, 18, 31, 0.86);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010;
}

.admin-content {
    padding: 24px;
    position: relative;
    z-index: 1;
}

.admin-content .card,
.admin-body .card {
    border-radius: 16px;
    border: 1px solid #2b3750;
    background: #141d2d;
    color: #d8e1f2;
    box-shadow: 0 14px 28px rgba(3, 8, 16, 0.35);
}

.admin-body .table {
    --bs-table-bg: transparent;
    --bs-table-color: #d8e1f2;
    --bs-table-border-color: #2b3750;
    --bs-table-striped-color: #d8e1f2;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-color: #f0f5ff;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

.admin-body .table > :not(caption) > * > * {
    background-color: transparent;
}

.admin-body .border {
    border-color: #2b3750 !important;
}

.admin-user {
    color: #a9b7d2;
}

.admin-body .text-secondary {
    color: #94a3be !important;
}

.admin-body .btn-outline-secondary {
    --bs-btn-color: #c8d4eb;
    --bs-btn-border-color: #3a4b6a;
    --bs-btn-hover-bg: #22314a;
    --bs-btn-hover-border-color: #4a5f85;
    --bs-btn-hover-color: #e8effc;
}

.admin-body .btn-dark {
    --bs-btn-bg: #2f63c9;
    --bs-btn-border-color: #2f63c9;
    --bs-btn-hover-bg: #3b73e1;
    --bs-btn-hover-border-color: #3b73e1;
}

.admin-body .form-control {
    background: #0f1726;
    border-color: #31415d;
    color: #e7edfb;
}

.admin-body .form-control::placeholder {
    color: #d9e3f7;
    opacity: 1;
}

.admin-body .form-control:focus {
    background: #0f1726;
    color: #f4f7ff;
    border-color: #4a6fb8;
    box-shadow: 0 0 0 0.2rem rgba(63, 120, 220, 0.2);
}

.admin-body .form-label {
    color: #b8c5df;
}

.admin-body .form-check-input {
    background-color: #0f1726;
    border-color: #31415d;
}

.admin-body .form-check-input:checked {
    background-color: #2f63c9;
    border-color: #2f63c9;
}

.admin-body .form-check-label {
    color: #b8c5df;
}

.admin-body .pagination {
    --bs-pagination-bg: #101a2c;
    --bs-pagination-border-color: #31415d;
    --bs-pagination-color: #cdd8ef;
    --bs-pagination-hover-bg: #1b2940;
    --bs-pagination-hover-border-color: #45629a;
    --bs-pagination-hover-color: #f2f7ff;
    --bs-pagination-active-bg: #2f63c9;
    --bs-pagination-active-border-color: #2f63c9;
    --bs-pagination-disabled-bg: #0f1726;
    --bs-pagination-disabled-color: #6e7e9f;
}

.admin-body code {
    color: #b4c6eb;
    background: rgba(63, 120, 220, 0.14);
    padding: 2px 6px;
    border-radius: 6px;
}

.admin-mobile-sidebar {
    background: linear-gradient(155deg, #0f1728 0%, #15213a 100%);
    color: #f2f6ff;
}

.admin-mobile-sidebar .offcanvas-header {
    border-bottom: 1px solid rgba(210, 223, 248, 0.16);
}

.admin-mobile-sidebar .offcanvas-body {
    padding: 14px;
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1030;
    }

    .admin-sidebar__inner {
        position: relative;
        top: auto;
    }

    .admin-main {
        margin-left: 340px;
    }

    .admin-topbar {
        left: 340px;
    }
}

@media (max-width: 991.98px) {
    .admin-main {
        padding-top: 64px;
    }

    .admin-topbar {
        min-height: 64px;
        padding: 0 14px;
        z-index: 1035;
    }

    .admin-content {
        padding: 16px;
    }
}

.miniapp-chart {
    display: grid;
    gap: 12px;
}

.miniapp-chart-row {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    align-items: start;
}

.miniapp-chart-day {
    font-size: 0.8rem;
    color: #aebbd4;
    padding-top: 3px;
}

.miniapp-chart-bars {
    display: grid;
    gap: 8px;
}

.miniapp-bar-wrap {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
}

.miniapp-bar-label {
    font-size: 0.75rem;
    color: #90a3c7;
}

.miniapp-bar {
    display: block;
    height: 8px;
    border-radius: 999px;
    min-width: 2px;
}

.miniapp-bar-users {
    background: linear-gradient(90deg, #497ddb 0%, #67a3ff 100%);
}

.miniapp-bar-sessions {
    background: linear-gradient(90deg, #2ea36d 0%, #56d68d 100%);
}

.miniapp-bar-errors {
    background: linear-gradient(90deg, #d57a35 0%, #eea35f 100%);
}

.miniapp-bar-value {
    text-align: right;
    font-size: 0.75rem;
    color: #c8d5ec;
}

.miniapp-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.miniapp-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(130, 156, 203, 0.26);
    padding: 5px 10px;
    font-size: 0.76rem;
    color: #b8c8e8;
    background: rgba(24, 40, 71, 0.4);
}

.miniapp-chip--period {
    border-color: rgba(121, 171, 255, 0.4);
    color: #d8e8ff;
    background: rgba(47, 92, 178, 0.28);
}

.miniapp-kpi-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.miniapp-kpi-hint {
    margin-top: auto;
    font-size: 0.75rem;
    color: #96accf;
    line-height: 1.35;
}

.miniapp-kpi-progress {
    height: 6px;
    background: rgba(93, 130, 188, 0.23);
    border-radius: 999px;
    overflow: hidden;
}

.miniapp-kpi-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4b81e4 0%, #68a9ff 100%);
}

.miniapp-kpi-progress--warn span {
    background: linear-gradient(90deg, #d9823d 0%, #edb168 100%);
}

.miniapp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.76rem;
    color: #a8bcde;
}

.miniapp-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.miniapp-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.miniapp-legend-dot--users {
    background: #67a3ff;
}

.miniapp-legend-dot--sessions {
    background: #56d68d;
}

.miniapp-legend-dot--errors {
    background: #eea35f;
}

.miniapp-row-error {
    background: rgba(173, 87, 45, 0.08);
}

.miniapp-score {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #d8e8ff;
    background: rgba(55, 107, 205, 0.33);
    border: 1px solid rgba(112, 156, 241, 0.3);
}

.market-alerts-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.market-alerts-table td {
    vertical-align: top;
}

.market-alerts-table .badge.text-bg-dark {
    background: rgba(48, 66, 101, 0.8) !important;
}

.market-alerts-actions .btn {
    text-align: left;
}

.market-alert-modal .modal-content,
.market-alert-modal {
    background: #141d2d;
    color: #d8e1f2;
}

.market-alert-modal .modal-header {
    border-bottom: 1px solid #2b3750;
}

.market-alert-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #dfe8fb;
}

@media (max-width: 991.98px) {
    .miniapp-bar-wrap {
        grid-template-columns: 78px minmax(0, 1fr) 36px;
        gap: 6px;
    }

    .miniapp-bar-label {
        font-size: 0.7rem;
    }
}
