:root:not([data-theme="dark"]) {
    --pico-font-family: "DM Sans", sans-serif;
    --pico-background-color: #f5f6fa;
    --pico-color: #1a1b2e;
    --pico-muted-color: #7b7e99;
    --pico-primary: #5d56f1;
    --pico-primary-background: var(--pico-primary);
    --pico-primary-border: var(--pico-primary);
    --pico-primary-hover: #4b45d1;
    --pico-primary-hover-background: var(--pico-primary-hover);
    --pico-primary-hover-border: var(--pico-primary-hover);
    --pico-primary-focus: var(--pico-primary);
    --pico-secondary: #eceaff;
    --pico-font-size: 100%;
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 0.75rem;
    --pico-primary-inverse: #fff;
    --pico-border-radius: 12px;
    --pico-border-color: #e8eaf0;
    --pico-muted-border-color: var(--pico-border-color);
    --pico-form-element-border-color: var(--pico-border-color);
    --pico-form-element-active-border-color: var(--pico-primary);
    --pico-form-element-focus-color: var(--pico-primary);
    --pico-h1-color: var(--pico-color);
    --pico-h2-color: var(--pico-color);
    --pico-h3-color: var(--pico-color);
    --pico-table-border-color: var(--pico-border-color);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --danger-background: #fff6f6;
    --sidebar-width: 280px;
}

body {
    font-family: var(--pico-font-family);
    color: var(--pico-color);
    background-color: var(--pico-background-color);
}

button,
[role="button"],
[type="submit"],
[type="button"],
[type="reset"],
[type="search"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    font-size: 0.8125rem;
}

button,
[role="button"],
[type="submit"] {
    img {
        filter: brightness(0) invert(1);
    }
}

[role="button"],
[type="submit"] {
    &.light {
        --pico-background-color: transparent;
        --pico-color: var(--pico-primary);
        --pico-border-color: transparent;
    }
    &.danger {
        --pico-background-color: var(--danger-color);
        --pico-color: var(--pico-primary-inverse);
        --pico-border-color: var(--danger-color);
    }
    &.outline.danger {
        --pico-primary-focus: var(--danger-color);
        --pico-background-color: var(--pico-primary-inverse);
        --pico-color: var(--danger-color);
        --pico-border-color: var(--danger-color);
    }
    &.light.danger {
        --pico-background-color: transparent;
        --pico-primary-focus: var(--danger-color);
        --pico-color: var(--danger-color);
        --pico-border-color: transparent;
    }
    &:is(:hover, :active, :focus, :focus-visible) {
        &.light {
            --pico-background-color: var(--pico-secondary);
            --pico-primary-focus: var(--pico-primary);
        }
        &.danger {
            --pico-primary-focus: var(--danger-color);
            --pico-background-color: var(--danger-color);
            --pico-color: var(--pico-primary-inverse);
            --pico-border-color: var(--danger-color);
        }
        &.outline.danger {
            --pico-background-color: var(--danger-background);
            --pico-color: var(--danger-color);
            --pico-border-color: var(--danger-color);
        }
        &.light.danger {
            --pico-background-color: var(--danger-background);
            --pico-color: var(--danger-color);
            --pico-border-color: transparent;
        }
    }
}

[role="button"]
[type="submit"] {
    &.danger img,
    &.outline.danger img {
        filter: none;
    }
}

[role="button"].danger:focus-visible,
[role="button"].outline.danger:focus-visible {
    outline: 2px solid rgb(220 53 69 / 40%);
    outline-offset: 2px;
}

[type="search"] {
    --pico-border-radius: inherit;
}

[type="checkbox"] {
    --pico-border-radius: .25rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.app-body {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
}

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

.app-main--standalone {
    min-height: 100vh;
}

.sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 100vh;
    padding: 0 12px;
    background: var(--pico-primary-inverse);
    border-right: 1px solid var(--pico-border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 8px 20px;
    color: var(--pico-color);
    text-decoration: none;
}

.sidebar-brand img {
    flex: 0 0 auto;
}

.sidebar-brand__name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 27px;
}

.sidebar-brand__name span {
    color: var(--pico-primary);
}

.sidebar-divider {
    margin: 0 0 4px;
    height: 1px;
    background-image: linear-gradient(to right, transparent, var(--pico-border-color), transparent);
}

.sidebar nav {
    padding-top: 20px;
    flex: 1;
    min-height: 0;
}

.sidebar nav ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar nav li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.sidebar nav li .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 9px 12px;
    border-radius: var(--pico-border-radius);
    color: var(--pico-muted-color);
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    text-decoration: none;
}

.sidebar nav li .sidebar-link[aria-current="page"] {
    background: var(--pico-secondary);
    color: var(--pico-primary);
    font-weight: 600;
}

.sidebar nav li .sidebar-link.is-disabled {
    cursor: default;
}

.nav-icon {
    display: block;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / 17px 17px no-repeat;
    mask: var(--icon) center / 17px 17px no-repeat;
}

.sidebar nav .nav-icon {
    position: relative;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    background: transparent;
    -webkit-mask: none;
    mask: none;
}

.sidebar nav .nav-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: var(--pico-secondary);
}

.sidebar nav .nav-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / 17px 17px no-repeat;
    mask: var(--icon) center / 17px 17px no-repeat;
}

.sidebar nav .sidebar-link[aria-current="page"] .nav-icon::before {
    background: var(--pico-secondary);
}

.sidebar-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--pico-background-color);
    color: var(--pico-muted-color);
    font-size: 11px;
    font-weight: 700;
    line-height: 16.5px;
}

.sidebar-link[aria-current="page"] .sidebar-badge {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 16px 8px 8px;
}

.sidebar-user__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-logout {
    padding: 0 8px 20px;
}

.sidebar-logout form {
    margin: 0;
}

button[type="submit"].sidebar-logout__button {
    justify-content: flex-start;
    background: transparent;
    color: var(--pico-muted-color);
    border: 0;

    &:hover,
    &:focus-visible {
        background: var(--pico-background-color);
        color: var(--pico-color);
    }
}

.sidebar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 16px;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    font-size: 13px;
    font-weight: 700;
    line-height: 19.5px;
}

.sidebar-user__email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    color: var(--pico-color);
    font-size: 13px;
    font-weight: 600;
    line-height: 19.5px;
    text-decoration: none;
}

.sidebar-user__email-text {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user__email-icon {
    flex-shrink: 0;
}

.sidebar-user__email:hover,
.sidebar-user__email:focus-visible {
    color: var(--pico-primary);
    text-decoration: underline;
}

.sidebar-user__email:hover .sidebar-user__email-icon,
.sidebar-user__email:focus-visible .sidebar-user__email-icon {
    filter: brightness(0) saturate(100%) invert(38%) sepia(89%) saturate(1752%) hue-rotate(228deg)
            brightness(99%) contrast(93%);
}

.sidebar-user__email[aria-current="page"] {
    color: var(--pico-primary);
}

.sidebar-user__email[aria-current="page"] .sidebar-user__email-icon {
    filter: brightness(0) saturate(100%) invert(38%) sepia(89%) saturate(1752%) hue-rotate(228deg)
            brightness(99%) contrast(93%);
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

@media (max-width: 991px) {
    .sidebar-toggle {
        --pico-background-color: var(--pico-primary-inverse);
        --pico-color: var(--pico-h1-color);
        --pico-border-color: var(--pico-border-color);
        display: inline-flex;
        position: fixed;
        z-index: 40;
        top: 12px;
        left: 12px;
        right: auto;
        margin: 0;
        padding: 8px 16px;
        border: 1px solid var(--pico-border-color);
        border-radius: var(--pico-border-radius);
        background-color: var(--pico-background-color);
        color: var(--pico-h1-color);
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
        transition: left 0.18s ease, right 0.18s ease;
    }

    .sidebar-toggle:is(:hover, :active, :focus, :focus-visible) {
        --pico-background-color: var(--pico-secondary);
        --pico-color: var(--pico-h1-color);
        --pico-border-color: var(--pico-border-color);
        background-color: var(--pico-background-color);
        color: var(--pico-h1-color);
    }

    .app-body.sidebar-open .sidebar-toggle {
        left: auto;
        right: 12px;
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
    }

    .sidebar.is-open {
        transform: none;
    }

    .sidebar-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        z-index: 20;
        inset: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: var(--pico-background-color);
    }

    .app-body .app-main {
        padding-top: 64px;
    }

    .app-body .confirm-delete {
        min-height: calc(100dvh - 64px);
        min-height: calc(100vh - 64px);
    }
}

.table {
    background: var(--pico-primary-inverse);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: var(--pico-secondary);
    color: var(--pico-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--pico-border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--pico-background-color);
}

.table td,
.table th {
    vertical-align: middle;
    border-top: none;
    border-bottom: 1px solid var(--pico-border-color);
    padding: 0.75rem 1rem;
}

.table-responsive {
    border-radius: var(--pico-border-radius);
    overflow: auto;
    margin-bottom: 1rem;
}

.pager li {
    margin: 0;
    padding: 0;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
    color: var(--pico-color);
    text-decoration: none;
}

.pager .is-current span {
    border-color: var(--pico-primary);
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
}

.pager .is-disabled span {
    color: var(--pico-muted-color);
}

.app-main:has(.confirm-delete) {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.confirm-delete {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 16px;
    box-sizing: border-box;
}

.confirm-delete .widget {
    width: 100%;
    max-width: 22rem;
    margin-bottom: 0;

    a {
        display: block;
        width: 100%;
        text-align: center;
    }
}

.confirm-delete .split.actions {
    width: 100%;
    max-width: 22rem;
}

.widget {
    background-color: var(--pico-primary-inverse);
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 50px;
    padding: 3rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 3rem;

    h2 {
        font-weight: 600;
        font-size: 1.2rem;
        color: var(--pico-color);
        margin-bottom: 1rem;
    }

    fieldset > legend {
        text-transform: uppercase;
        font-size: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: var(--pico-color);
        margin-bottom: 0rem;
    }

    h1 {
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
    }

    hr {
        border-color: var(--pico-primary);
    }
}


.icon-wrapper {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    background-color: var(--pico-primary);
    border-radius: 50%;
    padding: 0.5rem;

    i {
        font-size: 1rem;
        color: var(--pico-primary-inverse);
    }
}

.main__header {
    margin-bottom: 4rem;

    hr {
        border-color: var(--pico-primary);
    }
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.elements-list_add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.actions {
    margin-top: 3rem;
}

.with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.with-unit input,
.with-unit select {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.with-unit .unit {
    color: var(--pico-muted-color);
    white-space: nowrap;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form {
    .form-group {
        margin-bottom: 1rem;

        label {
            font-weight: 600;
            margin-bottom: 0.5rem;
            display: block;
        }

        .form-units {
            display: flex;
            align-items: center;

            .unit {
                margin-left: 0.5rem;
            }
        }
    }
}

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

.danger-link {
    color: var(--danger-color);
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
}

.list-group {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    overflow: hidden;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
}

.list-group > li {
    padding: 1rem;
    border-bottom: 1px solid var(--pico-border-color);
}

.list-group > li:last-child {
    border-bottom: none;
}

.list-group > li.is-warning {
    background: var(--warning-color);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--pico-secondary);
    color: var(--pico-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-muted {
    background: #f3f4f6;
    color: var(--pico-muted-color);
}

.badge-good {
    background: #f3f4f6;
    color: var(--pico-color);
}

.badge-medium {
    background: var(--warning-color);
    color: var(--pico-color);
}

.badge-bad {
    background: var(--danger-color);
    color: var(--pico-primary-inverse);
}


fieldset {
    border: 1px solid var(--pico-border-color);
    padding: 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    margin-top: 8px;
    margin-bottom: 1rem;
    color: #991b1b;
    font-size: 12px;
    line-height: 1.45;
}

.invalid-feedback ul,
.invalid-feedback .errorlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    list-style: none;
    border: 1px solid #fecaca;
    border-radius: var(--pico-border-radius);
    background: #fef2f2;
}

.invalid-feedback ul li,
.invalid-feedback .errorlist li {
    margin: 0;
    padding: 0;
    list-style: none;
    list-style-type: none;
    color: #991b1b;
}

.invalid-feedback ul li::marker,
.invalid-feedback .errorlist li::marker {
    content: none;
}


.app-screen {
    padding: 32px;
}

.app-screen form {
    margin: 0;
}

.app-screen__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-screen h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 33px;
    color: var(--pico-color);
}

.app-screen__subtitle {
    margin: 0;
    color: var(--pico-muted-color);
    font-size: 13px;
    font-weight: 400;
    line-height: 19.5px;
    padding-top: 3px;
}

.app-screen__section {
    margin-top: 24px;
}

.app-screen__section:first-of-type {
    margin-top: 20px;
}

.app-screen__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.app-screen__section h2,
.app-screen__section-head h2 {
    margin: 0;
    color: var(--pico-color);
    font-size: 15px;
    font-weight: 700;
    line-height: 22.5px;
}

.app-screen__section-actions {
    margin-top: 12px;
}

.app-screen__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-screen__actions input[type="search"] {
    width: auto;
    margin-bottom: 0;
}

.app-screen__toolbar,
.app-screen__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-screen__toolbar {
    padding-top: 24px;
}

.app-screen__toolbar:not(:has(.app-screen__year)) {
    justify-content: flex-end;
}

.analysis-kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0 32px;
}

.app-screen__toolbar-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-screen__toolbar-tools input[type="search"] {
    width: auto;
    margin-bottom: 0;
}

.app-screen .app-screen__year {
    width: auto;
    min-width: 7.5rem;
    margin: 0;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background-color: var(--pico-primary-inverse);
    color: var(--pico-color);
    font-size: 13px;
    line-height: 20px;
}

.view-toggle {
    --pico-spacing: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--pico-border-color);
    border-radius: 10px;
    background: var(--pico-primary-inverse);

    [role="button"] {
        --pico-form-element-spacing-horizontal: 0.75rem;
        --pico-background-color: var(--pico-primary-inverse);
        border: 0;
        img {
            filter: none;
        }

        &.is-active {
            background: var(--pico-secondary);
        }
    }
}

.app-screen__footer {
    padding-top: 16px;
}

.app-screen__footer-count {
    margin: 0;
    color: var(--pico-muted-color);
    font-size: 13px;
    font-weight: 400;
    line-height: 19.5px;
}

.app-screen .pager {
    margin: 0;
    gap: 4px;
}

.app-screen .pager a,
.app-screen .pager span {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--pico-color);
    font-size: 13px;
    font-weight: 500;
}

.app-screen .pager .is-current span {
    border: 0;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
}

.app-screen .pager .is-disabled span {
    color: #737887;
}

.app-info-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 32px 24px;
    border: 1px solid var(--pico-border-color);
    border-radius: 16px;
    background: #fafbfd;
    box-shadow: 0 1px 6px rgba(26, 27, 46, 0.04);
    p {
        text-align: center;
    }
}

.app-info-frame h2 {
    margin: 0;
    color: var(--pico-color);
    font-size: 15px;
    font-weight: 700;
    line-height: 22.5px;
}

.app-info-frame p {
    margin: 0;
    max-width: 28rem;
    color: var(--pico-muted-color);
    font-size: 13px;
    font-weight: 400;
    line-height: 19.5px;
}

.app-info-frame p:last-child {
    margin-top: 4px;
}

.app-table {
    margin-top: 20px;
    overflow: auto;
    background: var(--pico-primary-inverse);
    border: 1px solid var(--pico-border-color);
    border-radius: 16px;
    box-shadow: 0 1px 6px rgba(26, 27, 46, 0.04);
}

.app-screen table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: transparent;
}

.app-screen th,
.app-screen td {
    padding: 0 12px;
    border: 0;
    border-bottom: 1px solid var(--pico-border-color);
    text-align: left;
    vertical-align: middle;
}

.app-screen th:first-child,
.app-screen td:first-child,
.app-screen th:last-child,
.app-screen td:last-child {
    padding: 12px;
}

.app-screen thead th {
    height: 51px;
    background: #fafbfd;
    color: var(--pico-muted-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 18px;
    text-transform: uppercase;
}

.app-screen tbody td {
    height: 51px;
    background: var(--pico-primary-inverse);
    color: var(--pico-color);
    font-size: 13px;
    font-weight: 400;
    line-height: 19.5px;
}

.app-screen tbody tr:last-child td {
    border-bottom: 0;
}

.app-screen .app-id {
    color: var(--pico-primary);
    font-weight: 600;
    text-decoration: none;
}

.app-screen .app-id:hover {
    color: var(--pico-primary);
    text-decoration: none;
}

.app-screen .app-muted {
    color: var(--pico-muted-color);
}

.app-screen .app-amount {
    font-weight: 600;
}

.app-screen .app-edit,
.app-screen .app-view {
    display: inline-flex;
    padding: 4px;
    border-radius: 6px;
    line-height: 0;
}

.app-screen .app-table__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 800px) {
    .app-screen__header,
    .app-screen__toolbar,
    .app-screen__footer {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

body:has(.app-drawer) {
    overflow: hidden;
}

.app-drawer-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    background: rgba(26, 27, 46, 0.4);
}

.app-drawer {
    position: fixed;
    z-index: 60;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: 550px;
    max-width: 100%;
    height: 100vh;
    background: var(--pico-background-color);
    border-left: 1px solid var(--pico-border-color);
    box-shadow: -4px 0 16px rgba(26, 27, 46, 0.12);
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.app-drawer.is-open {
    transform: none;
}

.app-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--pico-border-color);
}

.app-drawer__header h2 {
    margin: 0;
    color: var(--pico-color);
    font-size: 17px;
    font-weight: 700;
    line-height: 25.5px;
}

.app-drawer__header p {
    margin: 3px 0 0;
    color: var(--pico-muted-color);
    font-size: 12px;
    line-height: 18px;
}

.app-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--pico-border-color);
    border-radius: 9px;
    background: var(--pico-background-color);
    color: var(--pico-color);
}

.app-drawer__icon-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--pico-border-color);
    border-radius: 9px;
    background: var(--pico-background-color);
    cursor: pointer;
}

.app-drawer__icon-btn:hover,
.app-drawer__icon-btn:focus-visible {
    border-color: var(--pico-primary);
    background: var(--pico-primary-inverse);
    outline: none;
    img {
        filter: none;
    }
}

.app-drawer__icon-btn.is-running {
    border-color: var(--danger-color);
    background: var(--danger-background);
    img {
        filter: none;
    }
}

.app-drawer .with-unit .app-drawer__icon-btn {
    box-shadow: none;
}

.app-drawer__form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.app-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 20px 24px;
}

.app-drawer__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--pico-border-color);
    background: var(--pico-primary-inverse);
}

.app-drawer__footer p {
    margin: 0 0 10px;
    color: #a8abbd;
    font-size: 11px;
    line-height: 16.5px;
}

.app-drawer__footer button,
.app-drawer__footer [role="button"].danger {
    width: 100%;
}

.app-drawer__footer [role="button"].danger {
    margin-top: 8px;
}

.app-drawer label {
    margin-bottom: 5px;
    color: var(--pico-color);
    font-size: 13px;
    font-weight: 500;
    line-height: 19.5px;
}

.app-drawer .hint {
    display: block;
    margin: 5px 0 0;
    color: var(--pico-muted-color);
    font-size: 11px;
    font-weight: 400;
    line-height: 16.5px;
}

.app-drawer .field-marker {
    color: var(--pico-primary);
}

.app-drawer .drawer-field-control input:not([type="file"]):not([type="checkbox"]):not([type="radio"]) {
    margin: 0;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
    box-shadow: none;
    color: var(--pico-color);
    font-size: 0.8125rem;
}

/* Chrome/Safari: space between value and native steppers */
/* Firefox does not allow to add padding between value and native steppers */
.app-drawer input[type="number"]::-webkit-inner-spin-button {
    margin-left: 8px;
}

.app-drawer .drawer-field-control select {
    height: 42px;
    margin: 0;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background-color: var(--pico-primary-inverse);
    background-image: url("../img/icons/icon-chevron.d16f89a03413.svg");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 8px 4px;
    box-shadow: none;
    color: var(--pico-color);
    font-size: 13px;
    line-height: 20px;
}

.app-drawer input[type="checkbox"],
.app-drawer input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--pico-primary);
    cursor: pointer;
}

.app-drawer textarea {
    min-height: 84px;
    margin: 0;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
    box-shadow: none;
    color: var(--pico-color);
    font-size: 13px;
}

.drawer-section h3 {
    margin: 0 0 12px;
    color: #a8abbd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 16.5px;
    text-transform: uppercase;
}

.drawer-section + .drawer-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--pico-border-color);
}

.drawer-section .drawer-field + .drawer-field {
    margin-top: 20px;
}

.drawer-section .form-group {
    margin: 0;
}

.drawer-section .form-group + .form-group {
    margin-top: 12px;
}

.app-drawer--use-wizard .use-wizard__general {
    margin-bottom: 16px;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
}

.app-drawer--use-wizard .use-wizard__general-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: var(--pico-color);
    font-size: 13px;
    font-weight: 600;
    line-height: 19.5px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.app-drawer--use-wizard .use-wizard__general-summary::-webkit-details-marker {
    display: none;
}

.app-drawer--use-wizard .use-wizard__general-summary::after {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 1.5px solid var(--pico-muted-color);
    border-bottom: 1.5px solid var(--pico-muted-color);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    content: "";
}

.app-drawer--use-wizard .use-wizard__general[open] > .use-wizard__general-summary::after {
    transform: rotate(-135deg);
}

.app-drawer--use-wizard .use-wizard__general-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--pico-border-color);
}

.app-drawer--use-wizard .use-wizard__general-body .drawer-section {
    margin-top: 12px;
}

.app-drawer--use-wizard .use-wizard__heading {
    margin: 0 0 12px;
    color: #a8abbd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 16.5px;
    text-transform: uppercase;
}

.app-drawer--use-wizard .use-wizard__fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.app-drawer--use-wizard .use-wizard__fieldset {
    margin-top: 2rem;
}

.app-drawer--use-wizard .use-wizard__fieldset legend {
    margin-bottom: 12px;
    padding: 0;
    color: var(--pico-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-transform: none;
    letter-spacing: normal;
}

.app-drawer--use-wizard .use-wizard__fieldset .form-group {
    margin: 0;
}

.app-drawer--use-wizard .use-wizard__fieldset .form-group + .form-group {
    margin-top: 12px;
}

.drawer-field--icon {
    display: grid;
}

.drawer-field--icon > img {
    z-index: 1;
    grid-row: 2;
    grid-column: 1;
    align-self: center;
    justify-self: start;
    margin-left: 12px;
    pointer-events: none;
}

.drawer-field--icon label {
    grid-row: 1;
    grid-column: 1;
}

.drawer-field--icon .with-unit,
.drawer-field--icon .drawer-field-control,
.drawer-field--icon .invalid-feedback {
    grid-row: 2;
    grid-column: 1;
}

.drawer-field--icon .invalid-feedback {
    grid-row: 3;
}

.drawer-field--icon .with-unit,
.drawer-field--icon .drawer-field-control {
    padding-left: 34px;
}

.drawer-field--icon .drawer-field-control input:not([type="checkbox"]):not([type="radio"]),
.drawer-field--icon .drawer-field-control select {
    width: 100%;
    box-sizing: border-box;
}

.app-drawer .with-unit {
    gap: 8px;
    height: 42px;
    padding-right: 12px;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
}

.app-drawer .with-unit input:not([type="checkbox"]):not([type="radio"]),
.app-drawer .with-unit select {
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--pico-color);
    font-size: 13px;
    line-height: 19.5px;
    font-weight: 400;
}

.app-drawer .with-unit input[type="number"] {
    padding-right: 4px;
}

.app-drawer:not(.app-drawer--consumption)
.with-unit:has(input[type="number"]):not(.with-unit--stopwatch)
input {
    text-align: right;
}

.app-drawer .with-unit.with-unit--stopwatch {
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    padding-right: 8px;
}

.app-drawer .with-unit.with-unit--stopwatch input[type="number"] {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.app-drawer .with-unit.with-unit--stopwatch .unit {
    flex-shrink: 0;
    order: 3;
}

.app-drawer .with-unit.with-unit--stopwatch .app-drawer__icon-btn {
    order: 2;
    flex-shrink: 0;
}

.app-drawer .with-unit .unit {
    color: #a8abbd;
    font-size: 12px;
    font-weight: 600;
}

.app-drawer .drawer-field-control {
    display: block;
}

.app-drawer .drawer-field-control input:not([type="checkbox"]):not([type="radio"]),
.app-drawer .drawer-field-control select,
.app-drawer .drawer-field-control textarea {
    width: 100%;
    box-sizing: border-box;
}

.drawer-split {
    display: grid;
    grid-template-columns: 50% minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.drawer-split--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.drawer-file {
    display: flex;
    align-items: center;
    gap: 5px;
}

.drawer-file__name {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid var(--pico-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-primary-inverse);
    color: var(--pico-muted-color);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.drawer-file__browse {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 42px;
    margin: 0;
    padding: 0 16px;
    overflow: hidden;
    border-radius: var(--pico-border-radius);
    background: #a8abbd;
    color: var(--pico-primary-inverse);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
}

.drawer-file__browse input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.app-drawer--building {
    width: 420px;
}

.app-drawer--building .app-drawer__header {
    padding: 20px 24px 16px;
}

.app-drawer--building .app-drawer__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 24px;
}

.app-drawer--building .drawer-section + .drawer-section {
    margin-top: 0;
}

.app-drawer--building .drawer-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-drawer--building .drawer-section h3 {
    margin: 0;
}

.app-drawer--building input:not([type="file"]),
.app-drawer--building select.app-drawer__select {
    height: 41.5px;
    padding: 10px 14px;
}

.app-drawer--building input::placeholder,
.app-drawer--building textarea::placeholder {
    color: rgba(26, 27, 46, 0.5);
}

.app-drawer--building select.app-drawer__select {
    padding-right: 36px;
    background-image: url("../img/icons/icon-chevron.d16f89a03413.svg");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 8px 4px;
}

.app-drawer--building textarea {
    min-height: 80.5px;
    padding: 10px 14px;
}

.app-drawer--building .drawer-split--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.app-drawer--consumption {
    width: 420px;
}

.app-drawer--consumption .app-drawer__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 24px;
}

.app-drawer--consumption .drawer-section + .drawer-section {
    margin-top: 0;
}

.app-drawer--consumption .drawer-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-drawer--consumption .drawer-section h3 {
    margin: 0;
}

.app-drawer--consumption .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.app-drawer--consumption .form-group > label {
    display: block;
}

.app-drawer--consumption .form-group .hint {
    margin-top: 5px;
}

.app-drawer--consumption .form-group--check {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
}

.app-drawer--consumption .form-group--check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.app-drawer--consumption .form-group--check label {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

.app-drawer--consumption .drawer-field-control input:not([type="checkbox"]):not([type="radio"]),
.app-drawer--consumption .drawer-field-control select,
.app-drawer--consumption .drawer-field-control textarea {
    padding: 10px 14px;
}

.app-drawer--consumption .with-unit {
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
}

.app-drawer--consumption .with-unit input,
.app-drawer--consumption .with-unit select {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    height: auto;
    width: auto;
    color: var(--pico-color);
    text-align: left;
}

.app-drawer--consumption .with-unit input[type="number"] {
    padding-right: 4px;
}

.app-drawer--consumption .with-unit .unit {
    flex-shrink: 0;
}

.app-drawer--consumption .with-unit.with-unit--stopwatch {
    padding-right: 8px;
}

.app-drawer--consumption .with-unit.with-unit--stopwatch .unit {
    order: 3;
}

.app-drawer--consumption .with-unit.with-unit--stopwatch .app-drawer__icon-btn {
    order: 2;
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .app-drawer,
    .app-drawer--building,
    .app-drawer--consumption {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-drawer {
        transform: none;
        transition: none;
    }
}
