:root {
    --app-bg: #1e1e1e;
    --app-panel: #242424;
    --app-panel-strong: #2a2a2a;
    --app-line: #3a3a3a;
    --app-line-soft: #303842;
    --app-text: #f5f7fb;
    --app-muted: #aab3be;
    --app-accent: #0dcaf0;
    --app-accent-dark: #092d35;
    --app-success: #29b36a;
    --app-warning: #f4c542;
    --app-danger: #ff6363;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: linear-gradient(180deg, #282828, #222);
}

.app-header-main {
    min-width: 0;
}

.app-title {
    margin: 0;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.18;
    color: var(--app-text);
}

.app-subtitle,
.app-user-line {
    color: var(--app-muted);
    font-size: 13px;
}

.app-user-line {
    margin-bottom: 5px;
}

.app-header-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
}

.app-nav-scroll,
.app-action-group,
.app-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.app-filter-bar {
    background: var(--app-panel);
    border: 1px solid var(--app-line);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.app-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.app-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-panel);
    color: var(--app-text);
    font-size: 14px;
    font-weight: 650;
}

.app-stat-pill strong {
    color: var(--app-accent);
}

.btn:not(.btn-close),
.btn-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 8px;
    font-weight: 650;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.btn:not(.btn-close):hover,
.btn-app:hover {
    transform: translateY(-1px);
}

.btn:not(.btn-close):active,
.btn-app:active {
    transform: translateY(0);
}

.btn-sm:not(.btn-close),
.btn-app-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.btn-primary,
.btn-info,
.btn-warning,
.btn-app-primary {
    border-color: #2adbf9 !important;
    background: var(--app-accent) !important;
    color: #071014 !important;
}

.btn-success,
.btn-app-success {
    border-color: #46ca82 !important;
    background: var(--app-success) !important;
    color: #07140d !important;
}

.btn-danger,
.btn-app-danger {
    border-color: #ff7b7b !important;
    background: #5a2027 !important;
    color: #fff1f1 !important;
}

.btn-secondary,
.btn-outline-light,
.btn-outline-secondary,
.btn-outline-info,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-warning,
.btn-app-secondary {
    border-color: #46515d !important;
    background: #20262b !important;
    color: #eef5fb !important;
}

.btn-outline-danger {
    border-color: #704048 !important;
    background: #2b1f22 !important;
    color: #ffb8b8 !important;
}

.btn-outline-success {
    border-color: #3c674d !important;
    color: #bff0ce !important;
}

.btn-outline-warning {
    border-color: #6b5a2c !important;
    color: #ffe49a !important;
}

.btn-outline-info,
.btn-outline-primary {
    border-color: #315a66 !important;
    color: #b8f1ff !important;
}

.top-bar {
    border-radius: 8px !important;
}

.modal-footer,
.modal-header {
    gap: 8px;
}

@media (max-width: 820px) {
    .app-header {
        display: block;
        padding: 12px;
        margin-bottom: 12px;
    }

    .app-title {
        font-size: 23px;
    }

    .app-header-side {
        align-items: stretch;
        margin-top: 12px;
    }

    .app-nav-scroll {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .app-action-group,
    .app-button-row {
        justify-content: flex-start;
    }

    .app-action-group .btn,
    .app-button-row .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .btn:not(.btn-close),
    .btn-app {
        min-height: 44px;
        white-space: normal;
    }

    .btn-sm:not(.btn-close),
    .btn-app-sm {
        min-height: 38px;
    }

    .app-filter-bar {
        padding: 12px;
    }

    .app-filter-bar .d-flex {
        flex-direction: column;
    }

    .app-stat-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-stat-pill {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 520px) {
    .app-action-group .btn,
    .app-button-row .btn {
        flex-basis: 100%;
    }
}


.i18n-floating-switch {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 3000;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
