:root {
    --aurelia-toast-bg: #202120;
    --aurelia-toast-text: #fffaf1;
    --aurelia-toast-success: #24594f;
    --aurelia-toast-error: #8e3638;
}

body {
    font-size: 14px;
}

.sidebar {
    width: 248px !important;
    padding: 18px !important;
    gap: 20px !important;
}

.brand {
    gap: 8px !important;
}

.brand img {
    width: min(190px, 100%) !important;
}

.brand small,
.footer-note {
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.brand small {
    white-space: nowrap !important;
}

.nav {
    gap: 7px !important;
}

.nav a,
.nav-toggle {
    min-height: 34px !important;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    font-weight: 560 !important;
}

.sidebar ~ main {
    width: calc(100% - 248px) !important;
    margin-left: 248px !important;
    padding: 20px 22px !important;
    gap: 14px !important;
}

body.sidebar-collapsed .sidebar ~ main {
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 58px !important;
}

.sidebar ~ main h1 {
    font-size: 24px !important;
    line-height: 1.12 !important;
}

.sidebar ~ main h2 {
    font-size: 17px !important;
}

.panel,
.metric,
.module-card,
.check-card {
    border-radius: 8px !important;
}

.panel {
    padding: 14px !important;
}

.metric {
    min-height: 86px !important;
    padding: 13px 14px !important;
}

.metric strong {
    font-size: 21px !important;
}

button,
.button-link,
.page-button,
.user-chip,
input,
select,
textarea {
    font-size: 13px !important;
}

button,
.button-link,
.user-chip {
    min-height: 36px !important;
    border-radius: 8px !important;
}

input,
select {
    min-height: 34px !important;
}

textarea {
    min-height: 84px;
}

th,
td {
    font-size: 12.5px;
}

@media (max-width: 780px) {
    .sidebar ~ main,
    body.sidebar-collapsed .sidebar ~ main {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 16px !important;
    }

    .sidebar {
        width: 100% !important;
        padding: 18px !important;
    }

    .table-wrap {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .table-wrap table {
        min-width: 860px !important;
        table-layout: auto !important;
    }

    .table-wrap th,
    .table-wrap td {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
}

.aurelia-toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 36px));
}

.aurelia-toast {
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--aurelia-toast-bg);
    color: var(--aurelia-toast-text);
    box-shadow: 0 16px 34px rgba(32, 33, 32, 0.18);
    font-size: 14px;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(8px);
    animation: aurelia-toast-in 180ms ease forwards;
}

.aurelia-toast.success { background: var(--aurelia-toast-success); }
.aurelia-toast.error { background: var(--aurelia-toast-error); }

@keyframes aurelia-toast-in {
    to { opacity: 1; transform: translateY(0); }
}

.aurelia-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.72;
}

.aurelia-loading::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.44);
    border-top-color: currentColor;
    animation: aurelia-spin 700ms linear infinite;
}

@keyframes aurelia-spin {
    to { transform: rotate(360deg); }
}

.pagination-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
    color: #756f65;
    font-size: 13px;
}

.page-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    background: #eadfce;
    color: #2c2a26;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 800;
}

.page-button.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.page-summary { color: #756f65; }
