:root {
    --font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
    --bg: #f5f5f5;
    --panel: #ffffff;
    --topbar: #444444;
    --border: #c4c4c4;
    --divider: #e2e2e2;
    --selected: #e6e6e6;
    --archive-row: #eef2f5;
    --archive-row-hover: #e3eaee;
    --row-hover: #f4f7f8;
    --text: #212121;
    --text-form: #333333;
    --muted: #5e5e5e;
    --muted-soft: #777777;
    --placeholder: #b8b8b8;
    --nav: #cccccc;
    --primary: #1d9d5a;
    --primary-hover: #188b4f;
    --primary-active: #147744;
    --warning: #f28c28;
    --warning-hover: #dc7814;
    --danger: #c0392b;
    --danger-bg: #fdecea;
    --ok-bg: #e9f5ef;
    --summary: #5e5e5e;
    --summary-strong: #444444;
    --radius-control: 4px;
    --radius-card: 4px;
    --shadow-topbar: 0 3px 8px rgba(0, 0, 0, 0.28);
    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.16), 0 2px 3px rgba(0, 0, 0, 0.06);
    --shadow-button: 0 2px 4px rgba(0, 0, 0, 0.24);
    --page-max-width: 1400px;
    --page-narrow-width: 850px;
    --page-gutter: 20px;
    --field-height: 56px;
    --button-height: 40px;
    --icon-button-size: 36px;
    --row-title-size: 17px;
    --control-pad-x: 13px;
    --button-pad-x: 16px;
}

/* LRCRM-0053: archive list grouping and the stored-PDF dialog. */
.belege-year-heading {
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid #d8d8d8;
    border-bottom: 1px solid #d8d8d8;
    background: #5e7684;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
}

.archive-document-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #d8d8d8;
    border-radius: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.archive-document-list-item {
    display: block;
}

.archive-document-row:hover {
    background: var(--archive-row-hover);
}

.archive-document-row:focus-visible {
    position: relative;
    z-index: 1;
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

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

.archive-pdf-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.archive-pdf-frame {
    display: block;
    width: 100%;
    height: min(82vh, 900px);
    border: 1px solid #dddddd;
    background: #f7f7f7;
}

.archive-pdf-frame[hidden] { display: none; }

.archive-pdf-modal-actions {
    justify-content: flex-end;
}

.tag.archive-tag {
    background: #e4e4e4;
    color: #4f4f4f;
    font-size: 13px;
}

.archive-pdf-missing {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.archive-pdf-missing-message {
    margin: 8px 0 14px;
}

.belege-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 12px;
}

.belege-pagination.is-load-more-active {
    display: none;
}

.belege-back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #5e7684;
    border-radius: 50%;
    background: #5e7684;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    color: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.belege-back-to-top:hover {
    background: #526a78;
}

.belege-back-to-top:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.belege-back-to-top[hidden] {
    display: none;
}

.belege-pagination .btn-sm.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.42;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover { color: var(--primary-hover); }

.topbar {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    background: var(--topbar);
    color: var(--nav);
    box-shadow: var(--shadow-topbar);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 46px;
    color: #ffffff;
}

.brand-logo {
    display: block;
    width: auto;
    height: 28px;
}

.topbar-nav {
    display: flex;
    align-items: stretch;
    align-self: stretch;
}

.topbar a,
.topbar button {
    color: var(--nav);
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
}

.topbar a:hover,
.topbar button:hover { color: #ffffff; }

.topbar-nav a.is-active {
    background: #151515;
    color: #ffffff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-actions form {
    margin: 0;
}

.topbar-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    cursor: pointer;
}

.topbar-icon::before {
    content: "";
    width: 20px;
    height: 20px;
    display: block;
    background: currentColor;
    mask-position: 50% 50%;
    mask-repeat: no-repeat;
    mask-size: 20px 20px;
    -webkit-mask-position: 50% 50%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 20px 20px;
}

.topbar-icon.is-active,
.topbar-icon:hover {
    background: #151515;
    color: #ffffff;
}

.icon-settings::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65-2-3.46-2.49 1a7.2 7.2 0 0 0-1.69-.98L15 3h-4l-.36 2.93c-.6.24-1.17.56-1.69.98l-2.49-1-2 3.46 2.11 1.65c-.04.32-.07.65-.07.98s.02.66.07.98l-2.11 1.65 2 3.46 2.49-1c.52.4 1.08.74 1.69.98L11 21h4l.36-2.93c.6-.24 1.17-.56 1.69-.98l2.49 1 2-3.46-2.11-1.65ZM13 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.65.07-.98s-.02-.66-.07-.98l2.11-1.65-2-3.46-2.49 1a7.2 7.2 0 0 0-1.69-.98L15 3h-4l-.36 2.93c-.6.24-1.17.56-1.69.98l-2.49-1-2 3.46 2.11 1.65c-.04.32-.07.65-.07.98s.02.66.07.98l-2.11 1.65 2 3.46 2.49-1c.52.4 1.08.74 1.69.98L11 21h4l.36-2.93c.6-.24 1.17-.56 1.69-.98l2.49 1 2-3.46-2.11-1.65ZM13 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z'/%3E%3C/svg%3E");
}

.icon-logout::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-8v-2h8V5h-8V3ZM9 8l-1.4 1.4L9.2 11H3v2h6.2l-1.6 1.6L9 16l4-4-4-4Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 3h8a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-8v-2h8V5h-8V3ZM9 8l-1.4 1.4L9.2 11H3v2h6.2l-1.6 1.6L9 16l4-4-4-4Z'/%3E%3C/svg%3E");
}

.wrap {
    width: min(calc(100% - 64px), var(--page-max-width));
    max-width: none;
    margin: 32px auto;
    padding: 0;
}

.wrap.page-narrow,
.auth-wrap,
.wrap > .panel:only-child {
    max-width: var(--page-narrow-width);
}

.wrap > .panel:only-child { margin-inline: auto; }

.wrap.page-form-wide {
    width: min(calc(100% - 72px), 1500px);
    max-width: 1500px;
}

.auth-wrap { width: min(calc(100% - 40px), 400px); }

.panel {
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.page-form-wide > .panel {
    width: 100%;
    max-width: none;
    padding: 16px;
}

.wrap.page-form-wide > .panel:only-child {
    max-width: none;
}

.panel + .panel,
.grid2 + .panel,
.panel + .grid2 { margin-top: 16px; }

h1 {
    margin: 0 0 24px;
    color: var(--text);
    font-size: 31px;
    line-height: 1.25;
    font-weight: 600;
}

h2 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 21px;
    line-height: 1.35;
    font-weight: 600;
}

.panel > h1,
.modal-panel h1 {
    margin-bottom: 16px;
    font-size: 22px;
    line-height: 28px;
}

.section-title {
    margin: 24px 0 12px;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 600;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: var(--field-height);
    padding: 0 var(--control-pad-x);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: #ffffff;
    color: var(--text-form);
    font: inherit;
    font-size: 15px;
    line-height: 22px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select {
    height: var(--field-height);
}

select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: calc(100% - 13px) 50%;
    background-size: 16px 16px;
    background-repeat: no-repeat;
}

textarea {
    min-height: 76px;
    padding: 13px var(--control-pad-x);
    resize: vertical;
}

input::placeholder,
textarea::placeholder { color: var(--placeholder); opacity: 1; }

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    outline: 0;
}

.btn,
.btn-sm {
    height: var(--button-height);
    min-height: var(--button-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-control);
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: var(--shadow-button);
    cursor: pointer;
    white-space: nowrap;
}

.btn { padding: 0 18px; }

.btn-sm {
    margin-top: 0;
    padding: 0 var(--button-pad-x);
}

.btn:hover,
.btn-sm:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: #ffffff;
}

.pill-link {
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary-hover);
    box-shadow: none;
}

.pill-link:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-dark {
    border-color: var(--summary-strong);
    background: var(--summary-strong);
}

.btn-dark:hover {
    border-color: #333333;
    background: #333333;
}

.btn-secondary {
    border-color: #777777;
    background: #777777;
}

.btn-secondary:hover {
    border-color: #5f5f5f;
    background: #5f5f5f;
}

button:disabled,
a[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}

.alert {
    padding: 10px 12px;
    border-radius: var(--radius-control);
    margin: 12px 0;
    font-size: 14px;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--primary-active); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.auth-link { margin-top: 16px; }

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

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
    flex-wrap: wrap;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 28px 0 32px;
}

.page-header h1 {
    margin: 0;
    flex: 1 1 auto;
}

.page-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 40px;
    min-width: 34px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.btn[hidden],
.btn-sm[hidden] { display: none; }

.page-back-button:hover {
    color: var(--text);
    background: transparent;
}

.page-back-button::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    mask-position: 50% 50%;
    mask-repeat: no-repeat;
    mask-size: 22px 22px;
    -webkit-mask-position: 50% 50%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 22px 22px;
}

.icon-back::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.2 5.2 7.4 12l6.8 6.8 1.3-1.3-5.5-5.5 5.5-5.5-1.3-1.3Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.2 5.2 7.4 12l6.8 6.8 1.3-1.3-5.5-5.5 5.5-5.5-1.3-1.3Z'/%3E%3C/svg%3E");
}

.table-toolbar {
    min-height: 92px;
    align-items: center;
    padding: 16px;
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.table-toolbar label {
    margin: 0;
}

.table-toolbar input[type="text"],
.table-toolbar input[type="search"] {
    width: min(100%, 400px);
}

.search-field {
    position: relative;
    width: min(100%, 400px);
}

.search-field input[type="search"] {
    width: 100%;
    padding-right: 46px;
}

.search-submit {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.search-submit::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    margin: auto;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 4a6.5 6.5 0 1 0 4.6 11.1l4.9 4.9 1.4-1.4-4.9-4.9A6.5 6.5 0 0 0 10.5 4Zm0 2a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 4a6.5 6.5 0 1 0 4.6 11.1l4.9 4.9 1.4-1.4-4.9-4.9A6.5 6.5 0 0 0 10.5 4Zm0 2a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.search-submit:hover,
.search-submit:focus-visible {
    color: var(--primary);
}

.search-submit:focus-visible {
    border-radius: 50%;
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.table-toolbar select {
    width: auto;
    min-width: 180px;
}

.table-toolbar .btn,
.table-toolbar .btn-sm {
    height: var(--field-height);
    min-height: var(--field-height);
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.btn-danger:hover {
    border-color: #a93226;
    background: #a93226;
}

table.list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    margin-top: 12px;
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

table.list th,
table.list td {
    height: 68px;
    padding: 0 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--divider);
    color: var(--text-form);
    font-size: 14px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.list thead th {
    height: 64px;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

table.list tbody tr:hover {
    background: var(--row-hover);
}

table.list tr:last-child td,
table.list tr:last-child th { border-bottom: none; }

table.list td.num,
table.list th.num { text-align: right; }

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--selected);
    color: var(--muted-soft);
    font-size: 12px;
    font-weight: 600;
}

.tag.on { background: var(--ok-bg); color: var(--primary-active); }

.tag.sent { background: #fff1df; color: #a85d00; }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Rechnung draft editor */
.page-form-wide #rechnung-form > .grid2 {
    grid-template-columns: minmax(520px, 1fr) minmax(230px, 360px);
    column-gap: 98px;
    align-items: end;
}

table.pos-table {
    display: block;
    margin-top: 0;
    table-layout: fixed;
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    counter-reset: position-row;
    overflow: visible;
}

table.pos-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

table.pos-table tbody,
table.pos-table tfoot,
table.pos-table tr,
table.pos-table td {
    display: block;
}

table.pos-table tbody {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-bottom: 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.pos-row {
    counter-increment: position-row;
    position: relative;
    display: grid !important;
    grid-template-columns: 48px minmax(420px, 1fr) 78px 122px 86px 118px 34px;
    gap: 8px;
    align-items: start;
    min-height: 154px;
    padding: 32px 22px 22px 40px;
    border-bottom: 1px solid var(--divider);
}

.pos-row::before {
    content: counter(position-row);
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #eeeeee;
    color: #444444;
    font-size: 14px;
    font-weight: 600;
}

table.pos-table td {
    position: relative;
    height: auto;
    padding: 0;
    border-bottom: 0;
    overflow: visible;
}

table.pos-table td::before {
    position: absolute;
    z-index: 1;
    margin: -10px 0 0 10px;
    padding: 0 4px;
    background: #ffffff;
    color: #777777;
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

table.pos-table td.pos-main::before { content: "Artikel"; }
.pos-row > td.pos-qty::before { content: "Menge"; }
.pos-row > td.pos-price::before { content: "VK (Netto)"; }
.pos-row > td.pos-discount::before { content: "Rabatt"; }

table.pos-table td.pos-main { width: auto; }

.pos-row .pos-main { grid-column: 2; }
.pos-row .pos-qty { grid-column: 3; }
.pos-row .pos-price { grid-column: 4; }
.pos-row .pos-discount { grid-column: 5; }
.pos-row .pos-desc {
    grid-column: 2 / 6;
    grid-row: 2;
}
.pos-row .pos-total {
    grid-column: 6;
    grid-row: 1;
}
.pos-row .pos-delete {
    grid-column: 7;
    grid-row: 1;
}

.pos-main input[data-name] {
    width: 100%;
    font-weight: 400;
}

.pos-main .art-combobox { position: relative; }

.pos-main .art-combobox input {
    width: 100%;
    font-weight: 400;
}

.pos-main .art-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--panel);
    box-shadow: var(--shadow-card);
}

.pos-main .art-results button {
    display: block;
    width: 100%;
    min-height: var(--button-height);
    padding: 9px 10px;
    border: 0;
    background: transparent;
    text-align: left;
    color: var(--text);
    cursor: pointer;
}

.pos-main .art-results button:hover,
.pos-main .art-results button[aria-selected="true"] { background: var(--ok-bg); }

.pos-desc textarea[data-desc] {
    width: 100%;
    min-height: 96px;
    overflow: hidden;
    padding: 13px;
    font-size: 15px;
    line-height: 22px;
    resize: none;
}

.pos-desc textarea[data-desc][hidden] { display: none; }

.pos-table input[type="text"] {
    min-height: var(--field-height);
    padding: 0 var(--control-pad-x);
    font-size: 15px;
}

.pos-table input[data-qty],
.pos-table input[data-price],
.pos-table input[data-disc] {
    width: 100%;
    text-align: right;
}

.pos-price input[data-price],
.pos-discount input[data-disc] {
    padding-right: 30px;
}

.pos-price::after,
.pos-discount::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-soft);
    font-size: 15px;
    line-height: 22px;
    pointer-events: none;
}

.pos-price::after { content: "€"; }
.pos-discount::after { content: "%"; }

.pos-row td[data-line-total] {
    padding-top: 9px;
    color: #212121;
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.pos-row td[data-line-total]::after { content: " €"; }

.pos-summary td {
    padding: 0;
    border: 0;
}

.invoice-summary {
    min-height: 86px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px 150px 220px;
    align-items: stretch;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
    color: #ffffff;
    background: #666666;
}

.invoice-summary__net { grid-column: 2; }
.invoice-summary__tax { grid-column: 3; }
.invoice-summary__gross { grid-column: 4; }

.invoice-summary__net,
.invoice-summary__tax,
.invoice-summary__gross {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 14px 28px;
}

.invoice-summary__net {
    background: #666666;
}

.invoice-summary__tax {
    align-items: center;
    padding-inline: 12px;
    background: #666666;
    color: #eeeeee;
}

.invoice-summary__gross {
    background: var(--summary-strong);
    font-weight: 700;
}

.invoice-summary span {
    color: #eeeeee;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    letter-spacing: 0;
}

.invoice-summary strong {
    color: #ffffff;
    font-size: 31px;
    line-height: 38px;
    font-weight: 400;
}

.invoice-summary__gross strong {
    font-weight: 700;
}

.invoice-summary strong::after { content: " €"; }

.pos-row.is-nonarticle [data-qty],
.pos-row.is-nonarticle [data-price],
.pos-row.is-nonarticle [data-disc] { opacity: 0.4; }

.pos-add-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin: 16px 0;
}

.del-row {
    width: var(--icon-button-size);
    height: var(--icon-button-size);
    min-width: var(--icon-button-size);
    min-height: var(--icon-button-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--muted);
    line-height: 1;
    cursor: pointer;
    font-size: 0;
}

.del-row:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.del-row::before,
.btn-icon-glyph::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    mask-position: 50% 50%;
    mask-repeat: no-repeat;
    mask-size: 18px 18px;
    -webkit-mask-position: 50% 50%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 18px 18px;
}

.btn-icon {
    gap: 8px;
}

.contact-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 8px;
    align-items: stretch;
}

.contact-select-row .btn-sm {
    height: var(--field-height);
    min-height: var(--field-height);
    border-color: #777777;
    background: #777777;
    color: #ffffff;
}

.contact-select-row .btn-sm:hover {
    border-color: #5f5f5f;
    background: #5f5f5f;
}

.modal-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 48px 16px;
    background: rgba(33, 33, 33, 0.45);
    overflow-y: auto;
}

.modal-backdrop[hidden] { display: none; }

.modal-panel {
    width: min(720px, 100%);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    background: var(--panel);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

.archive-pdf-modal-panel {
    width: min(1200px, 80vw);
}

@media (max-width: 640px) {
    .archive-pdf-modal {
        padding: 16px 8px;
    }

    .archive-pdf-modal-panel {
        width: 100%;
        padding: 12px;
    }

    .archive-pdf-frame {
        height: 65vh;
    }
}

.modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
}

.belege-create-actions,
.contacts-create-actions,
.dashboard-create-actions,
.items-create-actions,
.inline-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.belege-create-actions {
    position: relative;
    justify-content: flex-end;
    align-items: flex-start;
    min-width: 390px;
}

.contacts-create-actions,
.dashboard-create-actions,
.items-create-actions {
    justify-content: flex-end;
    margin-left: auto;
}

.correction-menu {
    position: relative;
}

.correction-menu > summary.btn-sm,
.belege-create-actions > button.btn-sm {
    border-color: var(--warning);
    background: var(--warning);
}

.correction-menu > summary.btn-sm:hover {
    border-color: var(--warning-hover);
    background: var(--warning-hover);
}

.correction-menu summary {
    list-style: none;
}

.correction-menu summary::-webkit-details-marker { display: none; }

.correction-menu summary.is-disabled {
    pointer-events: none;
}

.correction-picker {
    position: absolute;
    z-index: 10;
    top: calc(100% + 8px);
    right: 0;
    width: min(430px, calc(100vw - 48px));
    padding: 14px;
    border: 1px solid #dddddd;
    border-radius: var(--radius-card);
    background: var(--panel);
    box-shadow: var(--shadow-card);
}

.correction-picker label {
    margin-top: 0;
}

.correction-picker .btn-sm {
    width: 100%;
    margin-top: 10px;
}

.inline-create-form select { min-width: 280px; }

.belege-filter {
    min-height: 74px;
    align-items: stretch;
    gap: 10px;
}

.belege-status-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15%;
}

.belege-status-filter label {
    margin: 0;
}

.belege-filter select {
    height: var(--field-height);
    min-height: var(--field-height);
}

.belege-count {
    margin: 14px 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.belege-list {
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.contacts-list {
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.items-list {
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.dashboard-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.dashboard-belege-list {
    background: var(--panel);
    border: 1px solid #eeeeee;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.dashboard-beleg-header,
.dashboard-beleg-row {
    display: grid;
    grid-template-columns: 104px minmax(220px, 1fr) 142px 150px 116px 176px;
    gap: 10px;
    align-items: center;
    padding: 0 16px;
}

.dashboard-beleg-row:not(.archive-document-row):hover,
.contact-row:hover,
.item-row:hover {
    background: var(--row-hover);
}

.dashboard-beleg-header {
    min-height: 42px;
    border-bottom: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-beleg-header small {
    color: #a0a0a0;
    font-size: 9px;
    letter-spacing: 0;
}

.dashboard-beleg-row {
    min-height: 78px;
    padding-block: 14px;
    border-bottom: 1px solid #d8e1e6;
    background: #ffffff;
}

.archive-document-row {
    background: var(--archive-row);
}

.dashboard-beleg-row:last-child { border-bottom: none; }

.archive-document-list-item {
    border-bottom: 1px solid #d8e1e6;
}

.archive-document-list-item:last-child {
    border-bottom: none;
}

.archive-document-row {
    border-bottom: none;
}

.dashboard-beleg-number {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-beleg-client {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: var(--row-title-size);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-beleg-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted-soft);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}

.dashboard-beleg-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--muted);
    font-size: 15px;
    white-space: nowrap;
}

.dashboard-beleg-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--muted-soft);
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.dashboard-beleg-status {
    display: flex;
    justify-content: flex-start;
}

.document-detail-wrap {
    width: min(calc(100% - 72px), 1500px);
    max-width: 1500px;
}

.document-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.document-detail-main {
    min-width: 0;
}

.document-detail-sidebar {
    position: sticky;
    top: 62px;
}

.document-detail-sidebar h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.document-detail-sidebar h3 {
    margin: 18px 0 10px;
    font-size: 14px;
}

.document-email-history {
    margin-top: 18px;
}

.email-history-list {
    display: grid;
    gap: 10px;
}

.email-history-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.email-history-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.document-action-group {
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.document-action-group + .document-action-group {
    margin-top: 16px;
}

.document-action-group-payment {
    padding-bottom: 6px;
}

.document-action {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

.document-payment-form {
    margin-top: 8px;
}

.document-payment-form input,
.document-payment-form select {
    width: 100%;
}

.document-secondary-actions form {
    margin: 0;
}

.item-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px 128px 140px;
    gap: 16px;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.item-header-main {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(120px, 1fr);
    gap: 16px;
    min-width: 0;
}

.item-header-price {
    text-align: right;
}

.beleg-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 120px 184px;
    gap: 16px;
    align-items: center;
    min-height: 88px;
    padding: 14px 16px;
    border-bottom: 1px solid #d8d8d8;
    background: #ffffff;
}

.beleg-row:last-child { border-bottom: none; }

.contact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 16px;
    align-items: center;
    min-height: 78px;
    padding: 14px 16px;
    border-bottom: 1px solid #d8d8d8;
    background: #ffffff;
}

.contact-row:last-child { border-bottom: none; }

.contact-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 16px;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.contact-header-main {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}

.contact-sort {
    color: inherit;
    text-decoration: none;
}

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

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px 128px 140px;
    gap: 16px;
    align-items: center;
    min-height: 78px;
    padding: 14px 16px;
    border-bottom: 1px solid #d8d8d8;
    background: #ffffff;
}

.item-row:last-child { border-bottom: none; }

.beleg-main {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 4px 16px;
    align-items: baseline;
    min-width: 0;
    color: var(--text);
}

.beleg-main:hover {
    color: var(--text);
}

.contact-main {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 3px 16px;
    align-items: baseline;
    min-width: 0;
    color: var(--text);
}

.contact-main:hover {
    color: var(--text);
}

.item-main {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(120px, 1fr);
    gap: 16px;
    align-items: baseline;
    min-width: 0;
    color: var(--text);
}

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

.beleg-number {
    color: var(--primary-hover);
    font-size: 15px;
    font-weight: 600;
}

.contact-number {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.beleg-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: var(--row-title-size);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: var(--row-title-size);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: var(--row-title-size);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-description,
.contact-address {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-address {
    grid-column: 2;
}

.item-price {
    color: var(--muted-soft);
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.beleg-meta {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.beleg-amount {
    color: var(--muted-soft);
    font-size: 18px;
    text-align: right;
    white-space: nowrap;
}

.beleg-status {
    display: flex;
    justify-content: flex-start;
}

.beleg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.contact-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.beleg-actions form {
    margin: 0;
}

.contact-actions form {
    margin: 0;
}

.contact-delete-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--divider);
}

.contact-delete-actions form {
    margin: 0;
}

.item-actions form {
    margin: 0;
}

.icon-button {
    width: var(--icon-button-size);
    height: var(--icon-button-size);
    min-width: var(--icon-button-size);
    min-height: var(--icon-button-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d6d6d6;
    border-radius: var(--radius-control);
    background: #ffffff;
    color: #4d4d4d;
    font-size: 0;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.icon-button::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    mask-position: 50% 50%;
    mask-repeat: no-repeat;
    mask-size: 18px 18px;
    -webkit-mask-position: 50% 50%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 18px 18px;
}

.icon-button:hover {
    border-color: #bdbdbd;
    background: #f4f4f4;
    color: var(--text);
}

.icon-edit::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 17.25V20h2.75L17.8 8.95l-2.75-2.75L4 17.25Zm15.7-10.4a1 1 0 0 0 0-1.4L18.55 4.3a1 1 0 0 0-1.4 0l-.9.9L19 7.95l.7-.7Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 17.25V20h2.75L17.8 8.95l-2.75-2.75L4 17.25Zm15.7-10.4a1 1 0 0 0 0-1.4L18.55 4.3a1 1 0 0 0-1.4 0l-.9.9L19 7.95l.7-.7Z'/%3E%3C/svg%3E");
}

.icon-print::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h10v5H7V3Zm-1 7h12a3 3 0 0 1 3 3v4h-4v4H7v-4H3v-4a3 3 0 0 1 3-3Zm3 6v3h6v-3H9Zm9-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 3h10v5H7V3Zm-1 7h12a3 3 0 0 1 3 3v4h-4v4H7v-4H3v-4a3 3 0 0 1 3-3Zm3 6v3h6v-3H9Zm9-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z'/%3E%3C/svg%3E");
}

.icon-trash::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 3h6l1 2h5v2H3V5h5l1-2Zm-2 6h10l-.8 12H7.8L7 9Zm2.2 2 .55 8h4.5l.55-8H9.2Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 3h6l1 2h5v2H3V5h5l1-2Zm-2 6h10l-.8 12H7.8L7 9Zm2.2 2 .55 8h4.5l.55-8H9.2Z'/%3E%3C/svg%3E");
}

.icon-mail::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5h18v14H3V5Zm2 3.2V17h14V8.2l-7 4.6-7-4.6ZM6.8 7l5.2 3.4L17.2 7H6.8Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5h18v14H3V5Zm2 3.2V17h14V8.2l-7 4.6-7-4.6ZM6.8 7l5.2 3.4L17.2 7H6.8Z'/%3E%3C/svg%3E");
}

.icon-duplicate::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7V3h14v14h-4v4H3V7h4Zm2 0h8v8h2V5H9v2Zm-4 2v10h10V9H5Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7V3h14v14h-4v4H3V7h4Zm2 0h8v8h2V5H9v2Zm-4 2v10h10V9H5Z'/%3E%3C/svg%3E");
}

.icon-button:disabled,
.icon-button.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.belege-empty {
    min-height: 82px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.contacts-empty {
    min-height: 82px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.items-empty {
    min-height: 82px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.form-actions .btn,
.form-actions .btn-sm,
.finalize-form .btn,
.modal-actions .btn,
.modal-actions .btn-sm {
    height: var(--button-height);
    min-height: var(--button-height);
    margin-top: 0;
}

.inline-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}

.finalize-form,
.stacked-form { margin-top: 16px; }

.rechnung-actions .finalize-form {
    margin-top: 0;
}

.totals-block {
    margin: 16px 0;
    text-align: right;
    color: var(--text-form);
    line-height: 1.65;
}

.code-input {
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
}

hr {
    border: 0;
    border-top: 1px solid var(--divider);
    margin: 24px 0;
}

.dashboard-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-form {
    display: flex;
    gap: 8px;
    align-items: end;
}

.period-form label { margin: 0; }
.period-form input { width: 110px; }

@media (max-width: 900px) {
    .topbar {
        gap: 16px;
        align-items: flex-start;
        padding: 10px 16px;
        overflow-x: auto;
    }

    .wrap,
    .auth-wrap {
        width: calc(100% - 32px);
        margin-top: 28px;
    }

    .grid2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .page-form-wide #rechnung-form > .grid2 { grid-template-columns: 1fr; }

    .page-header {
        flex-wrap: wrap;
    }

    .table-toolbar {
        flex-direction: column;
    }

    .table-toolbar .search-field,
    .belege-filter .search-field {
        width: 100%;
    }

    table.list {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .pos-row {
        grid-template-columns: 38px minmax(0, 1fr) 34px;
        padding: 28px 16px 20px;
    }

    .pos-row .pos-main,
    .pos-row .pos-qty,
    .pos-row .pos-price,
    .pos-row .pos-discount,
    .pos-row .pos-desc,
    .pos-row .pos-total {
        grid-column: 2;
        grid-row: auto;
    }

    .pos-row .pos-delete {
        grid-column: 3;
        grid-row: 1;
    }

    .invoice-summary {
        grid-template-columns: 1fr;
        border-radius: 0 0 12px 12px;
    }

    .invoice-summary__net,
    .invoice-summary__tax,
    .invoice-summary__gross {
        grid-column: 1;
    }

    .invoice-summary__tax,
    .invoice-summary__gross { align-items: flex-end; }

    .contact-select-row,
    .inline-create-form {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .inline-create-form select { min-width: 0; }

    .belege-create-actions,
    .contacts-create-actions,
    .dashboard-create-actions,
    .items-create-actions {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
    }

    .correction-menu,
    .correction-menu summary,
    .correction-picker {
        width: 100%;
    }

    .correction-picker {
        position: static;
        margin-top: 8px;
    }

    .belege-filter {
        align-items: stretch;
    }

    .belege-status-filter {
        width: 100%;
        margin-left: 0;
    }

    .belege-filter select,
    .belege-filter .search-field {
        width: 100%;
    }

    .belege-status-filter select {
        flex: 1;
    }

    .beleg-row,
    .contact-row,
    .contact-header,
    .dashboard-beleg-header,
    .dashboard-beleg-row,
    .item-header,
    .item-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .beleg-main,
    .contact-main,
    .contact-header-main,
    .item-header-main,
    .item-main {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .beleg-meta,
    .contact-address {
        grid-column: 1;
    }

    .contact-header-main {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .beleg-amount,
    .beleg-status,
    .beleg-actions,
    .contact-actions,
    .dashboard-beleg-amount,
    .dashboard-beleg-status,
    .item-header-price,
    .item-price,
    .item-actions {
        justify-content: flex-start;
        text-align: left;
    }

    .document-detail-layout {
        grid-template-columns: 1fr;
    }

    .document-detail-sidebar {
        position: static;
    }
}
