:root {
    color-scheme: light;
    --sidebar-width: 248px;
    --page: #dfe6ef;
    --surface: #f3f6fa;
    --surface-muted: #e6edf5;
    --text: #20242b;
    --muted: #5b6572;
    --border: rgba(47, 59, 75, 0.20);
    --primary: #007aff;
    --primary-strong: #005ecb;
    --primary-soft: #d5e7fb;
    --success-bg: #d7ecdf;
    --success-text: #17803d;
    --warning-bg: #ffe8ad;
    --warning-text: #8a5a00;
    --danger-bg: #ffd9d6;
    --danger-text: #b3261e;
    --neutral-bg: #dbe2eb;
    --neutral-text: #343a43;
    --shadow: 0 12px 30px rgba(20, 28, 38, 0.08);
    --sidebar-animation-duration: 0.24s;
    --sidebar-animation-easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@property --sidebar-width {
    syntax: "<length>";
    inherits: true;
    initial-value: 248px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --page: #111316;
    --surface: #1b1f24;
    --surface-muted: #232832;
    --text: #f4f6f8;
    --muted: #a8b0bb;
    --border: rgba(235, 245, 255, 0.14);
    --primary: #4da3ff;
    --primary-strong: #8cc7ff;
    --primary-soft: rgba(77, 163, 255, 0.16);
    --success-bg: rgba(48, 209, 88, 0.14);
    --success-text: #7ee59a;
    --warning-bg: rgba(255, 214, 10, 0.16);
    --warning-text: #ffd76a;
    --danger-bg: rgba(255, 69, 58, 0.16);
    --danger-text: #ff8f86;
    --neutral-bg: rgba(235, 245, 255, 0.10);
    --neutral-text: #d8dee8;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --page: #111316;
        --surface: #1b1f24;
        --surface-muted: #232832;
        --text: #f4f6f8;
        --muted: #a8b0bb;
        --border: rgba(235, 245, 255, 0.14);
        --primary: #4da3ff;
        --primary-strong: #8cc7ff;
        --primary-soft: rgba(77, 163, 255, 0.16);
        --success-bg: rgba(48, 209, 88, 0.14);
        --success-text: #7ee59a;
        --warning-bg: rgba(255, 214, 10, 0.16);
        --warning-text: #ffd76a;
        --danger-bg: rgba(255, 69, 58, 0.16);
        --danger-text: #ff8f86;
        --neutral-bg: rgba(235, 245, 255, 0.10);
        --neutral-text: #d8dee8;
        --shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    }
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.18s;
    animation-timing-function: ease;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    animation-name: theme-view-fade-out;
}

::view-transition-new(root) {
    animation-name: theme-view-fade-in;
}

@keyframes theme-view-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes theme-view-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.theme-fade-fallback {
    transition: opacity 0.12s ease;
}

.theme-fade-fallback.theme-fade-fallback-out {
    opacity: 0.94;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(root),
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }

    .theme-fade-fallback {
        transition: none !important;
    }

    .theme-fade-fallback.theme-fade-fallback-out {
        opacity: 1;
    }

    .app-shell,
    body,
    .sidebar,
    .brand,
    .brand-main,
    .brand-full,
    .brand-icon,
    .brand-main span,
    .sidebar-toggle,
    .sidebar-toggle svg,
    .nav,
    .nav-item,
    .nav-item span,
    .sidebar-footer,
    .sidebar-control,
    .sidebar-user,
    .sidebar-control-text,
    .sidebar-user-text,
    .theme-current {
        transition: none !important;
    }
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    transition: --sidebar-width var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible;
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: padding var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    transition: padding var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.brand-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    transition: gap var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.brand-main span {
    max-width: 160px;
    max-height: 18px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.1;
    white-space: normal;
    opacity: 1;
    transform: translateX(0);
    transition: max-width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        max-height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.brand img {
    width: 104px;
    max-height: 38px;
    object-fit: contain;
}

.brand-icon {
    display: block;
    width: 0;
    max-height: 30px;
    opacity: 0;
    transform: scale(0.86);
    transition: width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.brand-full {
    opacity: 1;
    transform: scale(1);
    transition: width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        max-height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-self: flex-end;
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--muted);
    cursor: pointer;
    transition: width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        flex-basis var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        border-color 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease;
}

.sidebar-toggle:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.nav {
    display: grid;
    gap: 4px;
    padding-top: 12px;
    flex: 1 1 auto;
    align-content: start;
    transition: gap var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.nav-item,
.button,
.tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    position: relative;
    text-align: left;
    line-height: 1.2;
    transition: width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        min-height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        padding var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        gap var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

.nav-item span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: max-width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--muted);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color 0.15s ease, transform 0.15s ease;
}

.theme-icon-sun,
.theme-icon-moon {
    display: none;
}

.theme-control[data-theme-icon="sun"] .theme-icon-sun,
.theme-control[data-theme-icon="moon"] .theme-icon-moon {
    display: inline;
}

.nav-item:hover .nav-icon {
    color: var(--text);
}

.nav-item:hover,
.tab:hover,
.button:hover {
    background: var(--surface-muted);
}

.nav-item.active,
.tab.active,
.button.primary {
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
    color: var(--primary-strong);
}

.nav-item.active .nav-icon {
    color: var(--primary-strong);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    transition: gap var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        padding var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.sidebar-control,
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    position: relative;
    width: 100%;
    min-height: 42px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    transition: width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        min-height var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        padding var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        gap var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        border-color 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease;
}

.sidebar-user {
    cursor: pointer;
    text-align: left;
}

.theme-control {
    cursor: pointer;
}

.sidebar-control:hover,
.sidebar-user:hover {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--border));
}

.sidebar-control-icon,
.sidebar-user-icon,
.user-menu-action svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--muted);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-control-text,
.sidebar-user-text {
    max-width: 150px;
    min-width: 0;
    opacity: 1;
    transform: translateX(0);
    transition: max-width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.sidebar-control-text {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.theme-control {
    min-width: 0;
}

.theme-menu {
    position: relative;
}

.theme-current {
    margin-left: auto;
    max-width: 92px;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: max-width var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        opacity 0.16s ease,
        transform var(--sidebar-animation-duration) var(--sidebar-animation-easing),
        margin var(--sidebar-animation-duration) var(--sidebar-animation-easing);
}

.theme-menu-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 40;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-menu-action {
    width: 100%;
    min-height: 34px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.theme-menu-action:hover {
    background: var(--surface-muted);
}

.theme-menu-action.active {
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.user-menu {
    position: relative;
}

.sidebar-user-text {
    display: grid;
    gap: 2px;
}

.sidebar-user strong {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user span span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 40;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.user-menu-action {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 36px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--danger-text);
    cursor: pointer;
    text-align: left;
}

.user-menu-action:hover {
    background: var(--danger-bg);
}

.sidebar-footer .sidebar-toggle {
    width: 100%;
    margin-top: 0;
    align-self: stretch;
}

body.sidebar-collapsed {
    --sidebar-width: 64px;
}

body.sidebar-collapsed .sidebar {
    padding: 12px 8px;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    padding: 4px 0 12px;
}

body.sidebar-collapsed .brand-main {
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .brand-full,
body.sidebar-collapsed .brand-main span {
    max-width: 0;
    max-height: 0;
    opacity: 0;
    transform: translateX(-6px) scale(0.96);
}

body.sidebar-collapsed .brand-icon {
    width: 30px;
    max-height: 30px;
    opacity: 1;
    transform: scale(1);
}

body.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-toggle {
    align-self: center;
    width: 42px;
    height: 42px;
    flex-basis: 42px;
}

body.sidebar-collapsed .nav {
    gap: 7px;
    justify-items: center;
}

body.sidebar-collapsed .sidebar-footer {
    align-items: center;
    justify-items: center;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    gap: 0;
    width: 48px;
    min-height: 42px;
    padding: 9px 0;
}

body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-control-text,
body.sidebar-collapsed .theme-current,
body.sidebar-collapsed .sidebar-user-text {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
}

body.sidebar-collapsed .theme-current {
    flex-basis: 0;
    margin-left: 0;
}

body.sidebar-collapsed .nav-icon,
body.sidebar-collapsed .sidebar-control-icon,
body.sidebar-collapsed .sidebar-user-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

body.sidebar-collapsed .sidebar-control,
body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    gap: 0;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
}

body.sidebar-collapsed .theme-menu,
body.sidebar-collapsed .user-menu {
    width: 42px;
}

body.sidebar-collapsed .theme-menu-popover,
body.sidebar-collapsed .user-menu-popover {
    right: auto;
    bottom: 0;
    left: calc(100% + 12px);
    width: 150px;
}

body.sidebar-collapsed .nav-item:hover::after,
body.sidebar-collapsed .nav-item:focus-visible::after,
body.sidebar-collapsed .sidebar-control:hover::after,
body.sidebar-collapsed .sidebar-control:focus-within::after,
body.sidebar-collapsed .sidebar-user:hover::after,
body.sidebar-collapsed .sidebar-user:focus-visible::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    min-width: max-content;
    max-width: 220px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    pointer-events: none;
    z-index: 30;
}

body.sidebar-collapsed .theme-control[aria-expanded="true"]::after,
body.sidebar-collapsed .sidebar-user[aria-expanded="true"]::after {
    display: none;
}

body.sidebar-animating .nav-item::after,
body.sidebar-animating .sidebar-control::after,
body.sidebar-animating .sidebar-user::after {
    display: none !important;
}

.main {
    min-width: 0;
    padding: 16px;
}

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

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 25px;
    line-height: 1.15;
}

h2 {
    font-size: 17px;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
}

.toolbar,
.filters,
.tabs,
.actions {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.table-filter-form {
    display: grid;
    gap: 8px;
}

.masterdata-tabs {
    margin-bottom: 10px;
}

.filter-row {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-search {
    position: relative;
}

.filter-trigger {
    display: grid;
    min-width: 210px;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.filter-trigger span,
.filter-control span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.filter-trigger strong {
    max-width: 230px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-trigger.active {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.filter-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 50;
    width: min(320px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.filter-popover-actions,
.filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-popover-actions {
    justify-content: flex-end;
    margin-top: 8px;
}

.filter-control {
    min-width: 126px;
}

.filter-control select {
    min-width: 126px;
    max-width: 190px;
}

.filter-actions {
    margin-left: auto;
}

.split-detail:not(.detail-closed) .filter-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.05fr) repeat(3, minmax(88px, 0.62fr)) repeat(3, minmax(124px, 0.86fr)) auto;
    align-items: end;
}

.split-detail:not(.detail-closed) .filter-search,
.split-detail:not(.detail-closed) .filter-control,
.split-detail:not(.detail-closed) .filter-trigger,
.split-detail:not(.detail-closed) .filter-control select {
    min-width: 0;
    width: 100%;
}

.split-detail:not(.detail-closed) .filter-trigger strong {
    max-width: none;
}

.split-detail:not(.detail-closed) .filter-control select {
    max-width: none;
}

.split-detail:not(.detail-closed) .filter-actions {
    justify-content: flex-end;
    margin-left: 0;
}

.split-detail:not(.detail-closed) .filter-actions .button {
    min-height: 34px;
    padding-right: 8px;
    padding-left: 8px;
    white-space: nowrap;
}

.filter-summary {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 68%, transparent);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
}

.table-inline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.table-inline-actions .actions {
    justify-content: flex-end;
}

.view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.view-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.strong-cell,
.muted-cell {
    display: block;
}

.strong-cell {
    font-weight: 700;
}

.muted-cell {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.stacked-forms {
    display: grid;
    gap: 12px;
}

.compact-form {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-muted) 54%, var(--surface));
}

.lookup-create-form {
    margin-bottom: 12px;
}

.inline-editor-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.deadline-card {
    gap: 9px;
}

.deadline-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.deadline-card-head strong {
    color: var(--text);
    font-size: 14px;
}

.checkbox-field {
    align-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: var(--text);
}

.checkbox-field input {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
}

.receivable-filter-form .filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    align-items: end;
}

.receivable-filter-form .filter-control,
.receivable-filter-form .filter-control input,
.receivable-filter-form .filter-control select {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.receivable-filter-form .filter-actions {
    justify-content: flex-end;
    margin-left: 0;
}

.receivable-filter-form .filter-actions .button {
    min-height: 34px;
    white-space: nowrap;
}

.empty-actions {
    margin-top: 10px;
}

label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

input,
select,
textarea {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 9px;
    background: var(--surface);
    background-color: var(--surface);
    color: var(--text);
}

select,
select option,
select optgroup {
    background-color: var(--surface);
    color: var(--text);
    color-scheme: light;
}

select option:checked {
    background-color: color-mix(in srgb, var(--primary) 32%, var(--surface));
    color: var(--text);
}

[data-theme="dark"] select,
[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
    background-color: var(--surface);
    color: var(--text);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) select,
    :root:not([data-theme="light"]) select option,
    :root:not([data-theme="light"]) select optgroup {
        background-color: var(--surface);
        color: var(--text);
        color-scheme: dark;
    }
}

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

.invoice-form {
    display: grid;
    gap: 10px;
}

.invoice-form input,
.invoice-form select,
.invoice-form textarea {
    width: 100%;
    min-width: 0;
}

.invoice-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

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

.field-full {
    min-width: 0;
}

.form-actions,
.detail-actions {
    justify-content: flex-end;
}

.panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.panel-header-actions .button {
    white-space: nowrap;
}

.panel-body {
    padding: 12px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.kpi-action {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.kpi-action:hover,
.kpi-action:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 12%, transparent);
    transform: translateY(-1px);
}

.kpi-action:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 52%, transparent);
    outline-offset: 2px;
}

.kpi span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.kpi strong {
    display: block;
    font-size: 22px;
    line-height: 1.1;
}

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

.resizable-columns {
    position: relative;
}

.grid-2.resizable-columns,
.split-detail.resizable-columns {
    grid-template-columns: minmax(0, var(--column-left, 1fr)) minmax(0, var(--column-right, 1fr));
}

.column-resize-handle {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: var(--column-handle-left, 50%);
    z-index: 5;
    width: 24px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: col-resize;
    transform: translateX(-50%);
}

.column-resize-handle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    bottom: 16px;
    width: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 74%, var(--primary));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 88%, transparent);
    opacity: 0.34;
    transform: translateX(-50%);
    transition: opacity 0.16s ease, width 0.16s ease, background-color 0.16s ease;
}

.column-resize-handle:hover::before,
.column-resize-handle:focus-visible::before,
.resizing-columns .column-resize-handle::before {
    width: 4px;
    background: var(--primary);
    opacity: 0.82;
}

.column-resize-handle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 56%, transparent);
    outline-offset: 4px;
}

body.column-resize-active {
    cursor: col-resize;
    user-select: none;
}

body.column-resize-active * {
    cursor: col-resize !important;
}

.issue-workspace {
    align-items: start;
}

.issue-filter-form .filter-row {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.detail-text {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
}

.event-list {
    display: grid;
    gap: 8px;
}

.event-row {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.event-row span,
.event-row small {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 42%, var(--border)) transparent;
}

.table-wrap-long {
    max-height: min(64vh, 720px);
    overflow-y: auto;
}

.table-wrap-long th,
.table-wrap-long th.has-column-filter {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-wrap.can-drag-scroll,
.filter-row.can-drag-scroll {
    cursor: grab;
}

.table-wrap.can-drag-scroll :is(button, a, input, select, textarea, label, summary, [role="button"]),
.filter-row.can-drag-scroll :is(button, a, input, select, textarea, label, summary, [role="button"]) {
    cursor: revert;
}

.table-wrap.is-dragging,
.filter-row.is-dragging,
body.drag-scroll-active {
    cursor: grabbing;
    user-select: none;
}

body.drag-scroll-active * {
    cursor: grabbing !important;
}

.table-wrap::-webkit-scrollbar {
    height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 42%, var(--border));
    border-radius: 999px;
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 8px 9px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}

th {
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

th.has-column-filter {
    position: relative;
    padding-top: 7px;
    padding-bottom: 7px;
    vertical-align: top;
}

.table-wrap-has-filters th {
    padding-top: 7px;
    padding-bottom: 7px;
    vertical-align: top;
}

.table-header-cell {
    display: grid;
    align-items: start;
    gap: 6px;
    min-width: max-content;
}

.table-header-label {
    display: flex;
    align-items: flex-start;
    color: color-mix(in srgb, var(--text) 68%, var(--muted));
    font-size: 12px;
    font-weight: 800;
    line-height: 1.12;
}

.table-wrap-has-filters .table-header-label {
    min-height: 14px;
}

.table-wrap-has-filters th:not(.has-column-filter) .table-header-cell::after {
    content: "";
    display: block;
    min-height: 25px;
}

th.has-active-column-filter .table-header-label {
    color: var(--primary-strong);
}

th.has-active-column-filter .table-header-cell {
    position: relative;
}

.table-wrap-sticky {
    isolation: isolate;
}

.table-wrap-sticky :is(th, td).sticky-column {
    --sticky-column-bg: var(--surface);

    position: sticky;
    left: 0;
    min-width: 128px;
    max-width: 190px;
    background: var(--sticky-column-bg);
    background-clip: padding-box;
}

.table-wrap-sticky :is(th, td).sticky-column::after {
    content: "";
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 1px;
    pointer-events: none;
    background: color-mix(in srgb, var(--primary) 42%, var(--border));
    box-shadow: 8px 0 14px -14px rgba(15, 23, 42, 0.75);
    opacity: 0;
}

.table-wrap-sticky.is-scrolled-x :is(th, td).sticky-column::after {
    opacity: 1;
}

.table-wrap-sticky th.sticky-column {
    --sticky-column-bg: var(--surface-muted);

    z-index: 7;
    background: var(--sticky-column-bg);
}

.table-wrap-sticky td.sticky-column {
    z-index: 4;
}

.table-wrap-long th.sticky-column {
    z-index: 8;
}

.table-wrap-sticky tr:hover td.sticky-column {
    --sticky-column-bg: var(--surface-muted);

    background: var(--sticky-column-bg);
}

.table-wrap-sticky tr.selected-row td.sticky-column {
    --sticky-column-bg: var(--surface-muted);

    background: var(--sticky-column-bg);
}

th.has-active-column-filter .table-header-cell::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 0;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    opacity: 0.88;
}

.table-header-filter {
    display: grid;
    gap: 5px;
}

th.table-action-heading {
    text-align: right;
}

th.table-action-heading .table-header-cell {
    justify-items: end;
}

th.number .table-header-cell {
    justify-items: end;
}

.column-filter-control {
    width: 100%;
    max-width: 168px;
    min-width: 98px;
    min-height: 25px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    border-radius: 999px;
    padding: 3px 8px;
    background: color-mix(in srgb, var(--surface) 76%, var(--surface-muted));
    color: var(--text);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.column-filter-text {
    min-width: 142px;
    max-width: 180px;
}

.column-filter-search {
    position: relative;
    display: block;
    width: 100%;
    max-width: 180px;
    min-width: 142px;
    color: color-mix(in srgb, var(--muted) 84%, transparent);
}

.column-filter-search::before,
.column-filter-search::after {
    position: absolute;
    pointer-events: none;
    content: "";
}

.column-filter-search::before {
    top: 50%;
    left: 10px;
    width: 8px;
    height: 8px;
    border: 1.6px solid currentColor;
    border-radius: 50%;
    transform: translateY(-56%);
    z-index: 1;
}

.column-filter-search::after {
    top: calc(50% + 4px);
    left: 18px;
    width: 6px;
    height: 1.6px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
    z-index: 1;
}

.column-filter-search:focus-within,
.column-filter-search.active {
    color: var(--primary-strong);
}

.column-filter-search .column-filter-text {
    max-width: none;
    min-width: 0;
    padding-left: 26px;
}

.column-filter-search.has-clear .column-filter-text {
    padding-right: 28px;
}

.column-filter-clear {
    position: absolute;
    top: 50%;
    right: 4px;
    z-index: 2;
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary-strong);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-50%);
}

.column-filter-clear:hover,
.column-filter-clear:focus-visible {
    background: var(--primary);
    color: var(--surface);
    outline: none;
}

.column-filter-clear:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent);
}

.column-filter-select {
    padding-right: 24px;
}

.column-filter-popover {
    position: relative;
    display: block;
    width: max-content;
    max-width: 100%;
}

.column-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

.column-filter-button::after {
    width: 0;
    height: 0;
    border-top: 3px solid currentColor;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
    content: "";
    opacity: 0.76;
}

.column-filter-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 90;
    display: grid;
    width: min(250px, calc(100vw - 24px));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

th.number .column-filter-menu {
    right: 0;
    left: auto;
}

.column-filter-menu[hidden] {
    display: none;
}

.column-filter-menu label {
    gap: 4px;
    min-width: 0;
}

.column-filter-menu input,
.column-filter-menu select {
    width: 100%;
    min-width: 0;
}

.column-filter-menu-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.column-filter-control::placeholder {
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    font-weight: 700;
}

.column-filter-control:hover,
.column-filter-control:focus {
    border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
    background: var(--surface);
    outline: none;
}

.column-filter-control:focus {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.column-filter-control.active {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--primary-soft);
    color: var(--primary-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

td.number,
th.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

tr:hover td {
    background: color-mix(in srgb, var(--primary-soft) 42%, transparent);
}

tr.selected-row td {
    background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--primary) 18%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--primary) 18%, transparent);
}

.document-link {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-strong);
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-link:hover,
.document-link:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.document-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
}

.selection-context {
    display: grid;
    grid-template-columns: auto minmax(120px, 0.9fr) minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
}

.selection-context span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.selection-context strong,
.selection-context b {
    color: var(--text);
    font-size: 13px;
}

.selection-context em {
    min-width: 0;
    color: var(--text);
    font-style: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-context {
    margin-bottom: 4px;
}

.permissions-control {
    display: grid;
    gap: 0;
}

.permission-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 32px;
    padding: 3px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-muted) 72%, var(--surface));
}

.permission-mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    min-width: 82px;
    padding: 4px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.permission-mode-option:hover,
.permission-mode-option:focus-visible {
    color: var(--text);
}

.permission-mode-option.is-active {
    background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
    color: var(--primary-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

.permission-mode-option[data-permission-mode="edit"].is-active {
    background: color-mix(in srgb, var(--warning-bg) 68%, var(--surface));
    color: var(--warning-text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning-text) 24%, transparent);
}

.permissions-matrix {
    --permission-role-count: 4;
    display: grid;
    gap: 5px;
    max-height: min(62vh, 680px);
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.permission-head,
.permission-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.62fr) repeat(var(--permission-role-count), minmax(300px, 1fr));
    gap: 4px;
}

.permission-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0 4px 3px;
    background: var(--surface);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0;
}

.permission-head div {
    min-height: 24px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-muted) 68%, var(--surface));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-row {
    align-items: stretch;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
    overflow: hidden;
}

.permission-row:hover {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.permission-module,
.permission-cell {
    min-width: 0;
    padding: 6px 9px;
}

.permission-module {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    background: var(--surface-muted);
}

.permission-module strong {
    font-size: 12.5px;
    line-height: 1.2;
}

.permission-module span,
.permission-none,
.permission-role-mobile {
    color: var(--muted);
    font-size: 11px;
}

.permission-cell {
    display: flex;
    align-items: center;
    min-height: 40px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.permission-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    align-items: center;
    gap: 5px;
    width: 100%;
}

.permission-toggle,
.permission-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 27px;
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, var(--border) 76%, var(--muted));
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface));
    color: color-mix(in srgb, var(--text) 78%, var(--muted));
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.permission-toggle:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    color: var(--text);
}

.permission-toggle.active {
    border-color: color-mix(in srgb, var(--primary) 52%, transparent);
    background: color-mix(in srgb, var(--primary-soft) 86%, var(--surface));
    color: var(--primary-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent);
}

.permission-toggle.active:hover {
    background: var(--primary-soft);
}

.permission-toggle.locked {
    cursor: default;
}

.permissions-matrix.is-locked .permission-toggle {
    min-height: 24px;
    padding: 3px 7px;
    border-color: color-mix(in srgb, var(--border) 72%, transparent);
    background: color-mix(in srgb, var(--surface-muted) 48%, transparent);
    color: color-mix(in srgb, var(--muted) 82%, var(--text));
    box-shadow: none;
}

.permissions-matrix.is-locked .permission-toggle.active {
    border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
    background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
    color: var(--text);
}

.permissions-matrix.is-locked .permission-toggle.active::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 999px;
    background: var(--primary);
    flex: 0 0 auto;
}

.permission-toggle.locked:not(.active) {
    color: color-mix(in srgb, var(--muted) 88%, transparent);
    opacity: 0.82;
}

.permission-toggle.locked.active {
    opacity: 1;
}

.permission-toggle.confirming {
    border-color: color-mix(in srgb, var(--warning-text) 56%, var(--border));
    background: color-mix(in srgb, var(--warning-bg) 84%, var(--surface));
    color: var(--warning-text);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning-text) 18%, transparent);
}

.permission-toggle.pending {
    opacity: 0.65;
    cursor: progress;
}

.permission-toggle:disabled {
    opacity: 1;
    pointer-events: none;
}

.permission-chip.full {
    background: var(--success-bg);
    color: var(--success-text);
}

.empty-permission {
    background: transparent;
}

.permission-role-mobile {
    display: none;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.truncate {
    display: block;
    min-width: 0;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    background: var(--neutral-bg);
    color: var(--neutral-text);
}

.badge.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.duplicate-alert {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--warning-text) 34%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--warning-bg) 64%, var(--surface));
    color: var(--text);
}

.duplicate-alert strong {
    color: var(--warning-text);
    font-size: 13px;
}

.duplicate-alert span {
    color: var(--text);
    line-height: 1.35;
}

.metric-list {
    display: grid;
    gap: 8px;
}

.invoice-detail-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}

.invoice-detail-summary span,
.invoice-detail-total span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.invoice-detail-summary strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.15;
}

.invoice-detail-summary em {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--text);
    font-style: normal;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-detail-total {
    display: grid;
    justify-items: end;
    gap: 6px;
    text-align: right;
}

.detail-section {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.detail-section-title {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    text-transform: uppercase;
}

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

.detail-notes {
    gap: 6px;
}

.attachment-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
}

.attachment-form h4 {
    margin: 0;
    color: var(--text);
    font-size: 13px;
}

.attachment-form input,
.attachment-form select,
.attachment-form textarea {
    width: 100%;
    min-width: 0;
}

.detail-panel .detail-grid .detail-row,
.detail-panel .detail-notes .detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 7px 0;
}

.detail-panel .detail-row strong {
    min-width: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.metric-row,
.detail-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}

.metric-row span,
.detail-row span {
    color: var(--muted);
}

.bars {
    display: grid;
    gap: 8px;
}

.bar-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 120px;
    gap: 8px;
    align-items: center;
}

.bar {
    height: 9px;
    background: var(--surface-muted);
    border-radius: 999px;
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    background: var(--primary);
}

.report-grid {
    margin-top: 12px;
}

.report-mode-selector {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

.report-mode-button {
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.report-mode-button:hover,
.report-mode-button:focus-visible {
    color: var(--text);
    background: var(--surface);
}

.report-mode-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 52%, transparent);
    outline-offset: 2px;
}

.report-mode-button.active {
    color: var(--primary-strong);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, var(--border));
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.report-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface-muted);
    font-size: 12px;
}

.report-meta strong {
    color: var(--text);
    font-size: 12px;
}

.report-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.report-matrix {
    min-width: 760px;
}

.report-matrix th:first-child {
    min-width: 180px;
    text-align: left;
}

.report-matrix th,
.report-matrix td {
    padding: 10px 12px;
}

.report-matrix td {
    text-align: right;
    font-weight: 700;
}

.report-matrix-success td:first-of-type {
    color: var(--success);
}

.report-matrix-warning td:first-of-type {
    color: var(--warning);
}

.report-matrix-danger td:first-of-type {
    color: var(--danger);
}

.report-chart-wrap {
    min-width: 0;
}

.report-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 230px;
}

.report-axis,
.report-gridline {
    stroke: var(--border);
    stroke-width: 1;
}

.report-gridline {
    opacity: 0.7;
}

.report-axis-label,
.report-x-label {
    fill: var(--muted);
    font-size: 12px;
}

.report-x-label {
    text-anchor: middle;
}

.report-bar {
    rx: 4;
}

.report-bar.gross,
.report-legend .gross::before,
.report-stack-track .gross {
    fill: var(--primary);
    background: var(--primary);
}

.report-bar.paid,
.report-legend .paid::before {
    fill: var(--success);
    background: var(--success);
}

.report-stack-track .residual {
    background: var(--warning);
}

.report-stack-track .danger {
    background: var(--danger);
}

.report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

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

.report-legend span::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.report-bars {
    display: grid;
    gap: 12px;
}

.report-bar-stack,
.report-aging-row {
    display: grid;
    gap: 6px;
}

.report-bar-stack-head,
.report-aging-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.report-bar-stack-head {
    display: grid;
    gap: 8px;
}

.report-bar-stack-head span,
.report-aging-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-bar-stack small,
.report-aging-row small {
    color: var(--muted);
    font-size: 12px;
}

.report-aging-row {
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr) 120px;
}

.report-aging-row strong {
    text-align: right;
}

.report-stack-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.report-stack-track span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    min-width: 2px;
    border-radius: inherit;
}

.report-stack-track .residual {
    opacity: 0.72;
}

.report-stack-track.single span {
    position: static;
    display: block;
    height: 100%;
}

.report-focus-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.report-focus-card {
    min-height: 88px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.report-focus-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.report-focus-card strong {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.1;
}

.report-focus-card.gross strong {
    color: var(--primary-strong);
}

.report-focus-card.paid strong {
    color: var(--success);
}

.report-focus-card.residual strong {
    color: var(--warning);
}

.report-focus-card.danger strong {
    color: var(--danger);
}

.delta-positive {
    color: var(--success);
    font-weight: 700;
}

.delta-negative {
    color: var(--danger);
    font-weight: 700;
}

.delta-neutral {
    color: var(--muted);
    font-weight: 700;
}

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

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

.split-detail.detail-closed {
    grid-template-columns: minmax(0, 1fr);
}

.split-detail > * {
    min-width: 0;
}

.invoice-list-workspace {
    min-height: calc(100vh - 88px);
    min-width: 0;
    max-width: 100%;
}

.invoice-list-workspace > div,
.invoice-list-workspace > div > .panel,
.invoice-list-workspace > div > .panel > .panel-header,
.invoice-list-workspace > div > .panel > .panel-body,
.invoice-list-workspace .table-wrap {
    min-height: 0;
    min-width: 0;
    max-width: 100%;
}

.invoice-list-workspace > div {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.invoice-list-workspace > div > .panel {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    margin-bottom: 0;
    width: 100%;
}

.invoice-list-workspace > div > .panel > .panel-body {
    display: flex;
    flex-direction: column;
}

.invoice-list-workspace .table-wrap-long {
    flex: 1 1 auto;
    width: 100%;
    max-height: calc(100vh - 176px);
    min-height: min(560px, calc(100vh - 176px));
    overflow-y: auto;
}

.invoice-focus {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: calc(100vh - 96px);
}

.invoice-focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.invoice-focus-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.invoice-focus-title > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.invoice-focus-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
}

.invoice-focus-context strong,
.invoice-focus-context b {
    color: var(--text);
}

.invoice-focus-context span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-focus-body,
.invoice-focus-body > .panel {
    min-width: 0;
}

.invoice-focus-body > .panel {
    min-height: calc(100vh - 170px);
    margin-bottom: 0;
}

.invoice-focus .panel-body {
    padding: 14px;
}

.invoice-focus .invoice-form .form-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 8px;
    align-items: end;
}

.invoice-focus .invoice-form .form-grid > label {
    grid-column: span 3;
}

.invoice-focus .invoice-form .form-grid > .field-xs {
    grid-column: span 2;
}

.invoice-focus .invoice-form .form-grid > .field-sm {
    grid-column: span 2;
}

.invoice-focus .invoice-form .form-grid > .field-md {
    grid-column: span 3;
}

.invoice-focus .invoice-form .form-grid > .field-lg {
    grid-column: span 4;
}

.invoice-focus .invoice-form .form-grid > .field-xl {
    grid-column: span 5;
}

.invoice-focus .invoice-form .field-full {
    grid-column: 1 / -1;
}

.invoice-focus .invoice-form label > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
}

.invoice-focus .invoice-form input,
.invoice-focus .invoice-form select,
.invoice-focus .invoice-form textarea {
    min-height: 38px;
    border-color: color-mix(in srgb, var(--border), var(--text) 10%);
    background: color-mix(in srgb, var(--surface), var(--surface-muted) 38%);
}

.invoice-focus .invoice-form textarea {
    min-height: 62px;
    line-height: 1.45;
}

.invoice-focus .invoice-form .field-note-primary textarea {
    min-height: 72px;
}

.invoice-focus .invoice-form .field-note-compact textarea {
    min-height: 56px;
}

.invoice-focus .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-focus .detail-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-focus .detail-grid .detail-row,
.invoice-focus .detail-notes .detail-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 8px 0;
}

.invoice-focus .detail-actions {
    justify-content: flex-start;
    margin-bottom: 12px;
}

.invoice-focus .detail-actions .button {
    min-width: 160px;
}

.detail-panel {
    position: sticky;
    top: 16px;
    align-self: start;
}

.detail-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.detail-panel-header h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.detail-panel .panel-header {
    padding: 10px 12px;
}

.detail-panel .panel-body {
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.detail-panel .form-grid {
    grid-template-columns: 1fr;
}

.detail-panel .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}

.detail-panel .detail-actions .button {
    width: 100%;
    min-height: 34px;
}

.detail-panel .detail-actions .danger-button {
    grid-column: 1 / -1;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.danger-button {
    color: var(--danger-text);
    border-color: color-mix(in srgb, var(--danger-text) 28%, var(--border));
    background: var(--danger-bg);
}

.button.small {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 12px;
}

.auth-mode .main {
    display: grid;
    min-height: 100vh;
}

.auth-mode .app-shell {
    grid-template-columns: minmax(0, 1fr);
}

.auth-mode .sidebar {
    display: none;
}

.auth-mode .main {
    position: relative;
    padding: 16px;
}

.auth-mode .topbar {
    display: none !important;
}

.auth-panel {
    display: grid;
    min-height: calc(100vh - 32px);
    place-items: center;
}

.auth-card {
    display: grid;
    gap: 12px;
    width: min(380px, 100%);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card img {
    width: 124px;
    margin-bottom: 4px;
}

.form-error {
    min-height: 18px;
    color: var(--danger-text);
    font-size: 13px;
}

.compact-metrics {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .permission-head {
        display: none;
    }

    .panel-header.panel-header-permissions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .panel-header.panel-header-permissions .panel-header-actions {
        width: 100%;
        margin-left: 0;
    }

    .panel-header.panel-header-permissions .permission-mode-switch {
        width: 100%;
    }

    .panel-header.panel-header-permissions .permission-mode-option {
        flex: 1 1 0;
        min-width: 0;
    }

    .permissions-matrix {
        display: block;
    }

    .permission-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        min-height: 0;
        overflow: visible;
        margin-bottom: 5px;
    }

    .permission-row:last-child {
        margin-bottom: 0;
    }

    .permission-module {
        border-bottom: 1px solid var(--border);
    }

    .permission-cell {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: 0;
        padding: 8px;
        border-bottom: 1px solid var(--border);
    }

    .permission-cell:last-child {
        border-bottom: 0;
    }

    .permission-role-mobile {
        display: block;
        color: var(--text);
        font-weight: 700;
    }

    .permission-actions {
        grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
        gap: 4px;
    }

    .permission-toggle,
    .permission-chip {
        padding: 3px 5px;
        font-size: 11px;
    }

    body.sidebar-collapsed .app-shell {
        grid-template-columns: 1fr;
    }

    body.sidebar-collapsed .sidebar {
        padding: 12px;
    }

    body.sidebar-collapsed .brand {
        flex-direction: row;
        justify-content: space-between;
        padding: 4px 8px 12px;
    }

    body.sidebar-collapsed .nav {
        grid-template-columns: repeat(6, minmax(48px, 1fr));
    }

    body.sidebar-collapsed .sidebar-footer {
        grid-template-columns: repeat(3, minmax(48px, 1fr));
        align-items: stretch;
        border-top: 0;
        padding-top: 10px;
    }

    body.sidebar-collapsed .sidebar-control,
    body.sidebar-collapsed .sidebar-user,
    body.sidebar-collapsed .user-menu,
    body.sidebar-collapsed .sidebar-toggle {
        width: 100%;
    }

    body.sidebar-collapsed .user-menu-popover {
        right: 0;
        bottom: calc(100% + 8px);
        left: auto;
        width: 170px;
    }

    body.sidebar-collapsed .nav-item:hover::after,
    body.sidebar-collapsed .nav-item:focus-visible::after,
    body.sidebar-collapsed .sidebar-control:hover::after,
    body.sidebar-collapsed .sidebar-control:focus-within::after,
    body.sidebar-collapsed .sidebar-user:hover::after,
    body.sidebar-collapsed .sidebar-user:focus-visible::after {
        display: none;
    }

    .selection-context {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .selection-context em {
        white-space: normal;
    }

    .invoice-focus .invoice-form .form-grid,
    .invoice-focus .detail-grid,
    .invoice-focus .detail-notes {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .invoice-focus .invoice-form .form-grid > label,
    .invoice-focus .invoice-form .form-grid > .field-md {
        grid-column: span 3;
    }

    .invoice-focus .invoice-form .form-grid > .field-xs,
    .invoice-focus .invoice-form .form-grid > .field-sm {
        grid-column: span 2;
    }

    .invoice-focus .invoice-form .form-grid > .field-lg,
    .invoice-focus .invoice-form .form-grid > .field-xl,
    .invoice-focus .invoice-form .form-grid > .field-full {
        grid-column: 1 / -1;
    }

    .kpi-grid,
    .grid-2,
    .form-grid,
    .split-detail,
    .report-focus-grid {
        grid-template-columns: 1fr;
    }

    .column-resize-handle {
        display: none;
    }

    .split-detail:not(.detail-closed) .filter-row {
        display: flex;
        flex-wrap: wrap;
    }

    .detail-panel {
        position: static;
    }

    .detail-panel .panel-body {
        max-height: none;
        overflow-y: visible;
    }

    .invoice-list-workspace {
        min-height: auto;
    }

    .invoice-list-workspace > div > .panel,
    .invoice-list-workspace > div > .panel > .panel-body {
        display: block;
    }

    .invoice-list-workspace .table-wrap-long {
        max-height: min(68vh, 620px);
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 10px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-header {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .panel-header-actions {
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
    }

    .panel-header.panel-header-compact-action {
        align-items: center;
        flex-wrap: nowrap;
    }

    .panel-header.panel-header-compact-action .panel-header-actions {
        flex: 0 0 auto;
        justify-content: flex-end;
        width: auto;
        margin-left: auto;
    }

    .panel-header.panel-header-permissions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .panel-header.panel-header-permissions .panel-header-actions {
        flex: 1 0 100%;
        justify-content: stretch;
        width: 100%;
        margin-left: 0;
    }

    .panel-header.panel-header-permissions .permission-mode-switch {
        width: 100%;
    }

    .panel-header.panel-header-permissions .permission-mode-option {
        flex: 1 1 0;
        min-width: 0;
    }

    .panel-header-actions .button {
        width: auto;
    }

    .panel-header.panel-header-compact-action {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .panel-header.panel-header-compact-action .panel-header-actions {
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
    }

    .report-mode-selector {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .report-mode-button {
        width: 100%;
        text-align: center;
    }

    .invoice-focus {
        min-height: auto;
    }

    .invoice-focus-header,
    .invoice-focus-context {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-focus-body > .panel {
        min-height: auto;
    }

    .invoice-focus .invoice-form .form-grid,
    .invoice-focus .detail-grid,
    .invoice-focus .detail-notes,
    .invoice-detail-summary {
        grid-template-columns: 1fr;
    }

    .invoice-focus .invoice-form .form-grid > label,
    .invoice-focus .invoice-form .form-grid > .field-xs,
    .invoice-focus .invoice-form .form-grid > .field-sm,
    .invoice-focus .invoice-form .form-grid > .field-md,
    .invoice-focus .invoice-form .form-grid > .field-lg,
    .invoice-focus .invoice-form .form-grid > .field-xl,
    .invoice-focus .invoice-form .form-grid > .field-full {
        grid-column: 1 / -1;
    }

    .invoice-focus .detail-actions .button {
        min-width: 0;
    }

    .invoice-detail-total {
        justify-items: start;
        text-align: left;
    }

    .toolbar,
    .filters,
    .actions {
        align-items: stretch;
    }

    .toolbar label,
    .filters label,
    .filters input,
    .filters select,
    .button,
    .tab {
        width: 100%;
    }

    .table-filter-form {
        margin: -2px 0;
    }

    .filter-row {
        align-items: stretch;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: thin;
    }

    .filter-search,
    .filter-control,
    .filter-actions {
        flex: 0 0 auto;
    }

    .filter-trigger {
        min-width: 190px;
    }

    .filter-control select {
        width: auto;
        min-width: 132px;
    }

    .filter-actions {
        margin-left: 0;
        flex-wrap: nowrap;
    }

    .receivable-filter-form .filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .receivable-filter-form .filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .table-filter-form .button {
        width: auto;
        white-space: nowrap;
    }

    .view-toolbar {
        align-items: stretch;
    }

    .view-toolbar .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .view-toolbar-actions {
        justify-content: flex-start;
    }

    .table-header-cell {
        gap: 5px;
    }

    .column-filter-control {
        min-width: 92px;
        min-height: 25px;
        padding: 3px 7px;
        font-size: 11px;
    }

    .column-filter-text {
        min-width: 128px;
    }

    .column-filter-search {
        max-width: 168px;
        min-width: 128px;
    }

    .column-filter-menu {
        width: min(232px, calc(100vw - 24px));
    }

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

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

    .kpi strong {
        font-size: 20px;
        overflow-wrap: anywhere;
    }
}
