:root {
    --color-brand: #af2b1e;
    --color-brand-dark: #8f2117;
    --color-alert: #c8102e;
    --color-ink: #171c1a;
    --color-muted: #66706b;
    --color-canvas: #f5f5f3;
    --color-surface: #ffffff;
    --color-warm: #fff7f4;
    --color-border: #e8e3df;
    --shadow-card: 0 8px 28px rgba(23, 28, 26, 0.055);
    color-scheme: light;
    font-synthesis: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--color-canvas);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--color-ink);
    background: var(--color-canvas);
    font-family: "Manrope", "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.94rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-brand);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--color-brand-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(175, 43, 30, 0.32);
    outline-offset: 3px;
}

::selection {
    color: #fff;
    background: var(--color-brand);
}

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

h1,
h2,
h3 {
    color: var(--color-ink);
    font-weight: 800;
    letter-spacing: -0.03em;
}

h1:focus {
    outline: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-brand);
    border-color: var(--color-brand);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: var(--color-brand-dark);
    border-color: var(--color-brand-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    border-color: rgba(175, 43, 30, 0.55);
    box-shadow: 0 0 0 0.22rem rgba(175, 43, 30, 0.16);
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: #d9d4d0;
    border-radius: 0.65rem;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #2c8a57;
}

.invalid {
    outline: 1px solid var(--color-alert);
}

.validation-message {
    color: var(--color-alert);
}

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 3.75rem;
    color: #fff;
    background: var(--color-alert);
    border-radius: 0.7rem;
}

.blazor-error-boundary::after {
    content: "Ein unerwarteter Fehler ist aufgetreten.";
}

.darker-border-checkbox.form-check-input {
    border-color: #8b918e;
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.2vw, 2rem);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.page-heading > div:first-child {
    max-width: 720px;
}

.eyebrow,
.section-kicker {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--color-brand);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.3;
    text-transform: uppercase;
}

.page-heading h1 {
    margin-bottom: 0.4rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.15;
}

.page-heading p {
    margin-bottom: 0;
    color: var(--color-muted);
    font-size: clamp(0.88rem, 1.4vw, 1rem);
}

.page-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.68rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 0.72rem;
    font-size: 0.85rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button svg,
.text-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-primary {
    color: #fff;
    background: var(--color-brand);
    border-color: var(--color-brand);
    box-shadow: 0 7px 18px rgba(175, 43, 30, 0.2);
}

.button-primary:hover {
    color: #fff;
    background: var(--color-brand-dark);
    border-color: var(--color-brand-dark);
    box-shadow: 0 9px 22px rgba(175, 43, 30, 0.25);
}

.button-secondary {
    color: var(--color-ink);
    background: #fff;
    border-color: var(--color-border);
}

.button-secondary:hover {
    color: var(--color-brand);
    background: var(--color-warm);
    border-color: #dfcbc4;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.metric-card {
    position: relative;
    min-height: 142px;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    overflow: hidden;
    padding: 1.15rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
}

.metric-card::after {
    position: absolute;
    right: -28px;
    bottom: -38px;
    width: 100px;
    height: 100px;
    background: rgba(175, 43, 30, 0.035);
    border-radius: 50%;
    content: "";
}

.metric-card-brand {
    background: var(--color-warm);
    border-color: #ead7d1;
}

.metric-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand);
    background: #f9e9e5;
    border-radius: 0.7rem;
}

.metric-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.metric-label {
    min-height: 2.4em;
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1.25;
}

.metric-value {
    margin: 0.05rem 0 0.15rem;
    color: var(--color-ink);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.metric-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #858b88;
    font-size: 0.63rem;
    font-weight: 650;
    white-space: nowrap;
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: #c3c7c5;
    border-radius: 50%;
    animation: loading-pulse 1.6s ease-in-out infinite;
}

.quick-section {
    padding: 0.2rem 0;
}

.section-heading,
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-heading {
    margin-bottom: 0.85rem;
}

.section-heading h2,
.panel-heading h2 {
    margin-bottom: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.quick-card {
    min-height: 96px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    color: var(--color-ink);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    box-shadow: 0 5px 20px rgba(23, 28, 26, 0.035);
    text-decoration: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.quick-card:hover {
    color: var(--color-ink);
    border-color: #d8bbb3;
    box-shadow: 0 10px 28px rgba(23, 28, 26, 0.08);
    transform: translateY(-2px);
}

.quick-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand);
    background: var(--color-warm);
    border: 1px solid #f1ded8;
    border-radius: 0.75rem;
}

.quick-icon svg,
.quick-arrow {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.quick-copy strong {
    font-size: 0.84rem;
    font-weight: 800;
}

.quick-copy span {
    overflow: hidden;
    color: var(--color-muted);
    font-size: 0.69rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-arrow {
    width: 18px;
    height: 18px;
    color: #989e9b;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
    align-items: stretch;
    gap: 0.9rem;
}

.panel {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
}

.panel-heading {
    min-height: 76px;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--color-border);
}

.text-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0;
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.text-link svg {
    width: 16px;
    height: 16px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    min-width: 610px;
    border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.8rem 1.15rem;
    text-align: left;
}

.dashboard-table th {
    color: #777e7a;
    background: #fbfbfa;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-table td {
    height: 57px;
    border-bottom: 1px solid #efedeb;
}

.dashboard-table tr:last-child td {
    border-bottom: 0;
}

.skeleton {
    display: block;
    height: 10px;
    background: linear-gradient(90deg, #efedeb 20%, #f7f6f5 45%, #efedeb 70%);
    background-size: 220% 100%;
    border-radius: 999px;
    animation: skeleton-shimmer 1.7s ease-in-out infinite;
}

.skeleton-short {
    width: 68px;
}

.skeleton-wide {
    width: min(180px, 85%);
}

.skeleton-status {
    width: 82px;
    height: 22px;
}

.skeleton-medium {
    width: 92px;
}

.day-panel {
    display: flex;
    flex-direction: column;
}

.workflow-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.55rem 1.15rem;
    list-style: none;
}

.workflow-list li {
    position: relative;
    min-height: 62px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
}

.workflow-list li:not(:last-child)::after {
    position: absolute;
    top: 45px;
    bottom: -5px;
    left: 17px;
    width: 1px;
    background: var(--color-border);
    content: "";
}

.workflow-number {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-brand);
    background: var(--color-warm);
    border: 1px solid #f0d9d3;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
}

.workflow-list li > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.workflow-list strong {
    font-size: 0.79rem;
    font-weight: 800;
}

.workflow-list small {
    color: var(--color-muted);
    font-size: 0.66rem;
}

.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: auto 1.15rem 1.15rem;
    padding: 0.8rem;
    color: #615751;
    background: var(--color-warm);
    border: 1px solid #f0ddd7;
    border-radius: 0.72rem;
}

.tip-box svg {
    width: 19px;
    min-width: 19px;
    height: 19px;
    margin-top: 1px;
    fill: none;
    stroke: var(--color-brand);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tip-box p {
    margin: 0;
    font-size: 0.66rem;
    line-height: 1.5;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Shared application forms, tables and workflow details */
.app-page {
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 2vw, 1.75rem);
}

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

.content-grid-two-thirds {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr);
}

.compact-field {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--color-muted);
    font-size: .74rem;
    font-weight: 800;
}

.compact-field .form-select {
    width: auto;
    min-width: 105px;
}

.notice {
    padding: .85rem 1rem;
    border: 1px solid;
    border-radius: .75rem;
    font-size: .86rem;
    font-weight: 650;
}

.notice-success {
    color: #195b3b;
    background: #edf8f1;
    border-color: #b8dfc7;
}

.notice-warning {
    color: #73510d;
    background: #fff8e8;
    border-color: #ead49c;
}

.notice-error {
    color: #8e1c2d;
    background: #fff1f3;
    border-color: #efc0c8;
}

.empty-state {
    padding: 2rem 1.15rem;
    text-align: center;
    color: var(--color-muted);
}

.empty-state p:last-child {
    margin-bottom: 0;
}

.compact-empty {
    padding: 1.4rem;
}

.summary-list {
    margin: 0;
    padding: .45rem 1.15rem 1rem;
}

.summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid #efedeb;
}

.summary-list > div:last-child {
    border-bottom: 0;
}

.summary-list dt {
    color: var(--color-muted);
    font-size: .76rem;
    font-weight: 700;
}

.summary-list dd {
    margin: 0;
    text-align: right;
    font-size: .82rem;
    font-weight: 800;
}

.summary-list dd small {
    display: block;
    color: var(--color-muted);
    font-weight: 600;
}

.summary-list .summary-total {
    margin-top: .25rem;
    padding-top: .95rem;
    border-top: 2px solid var(--color-ink);
}

.summary-total dt,
.summary-total dd {
    color: var(--color-ink);
    font-size: .92rem;
}

.data-table td {
    vertical-align: middle;
    font-size: .78rem;
}

.data-table strong {
    font-weight: 800;
}

.table-subline {
    display: block;
    margin-top: .12rem;
    color: var(--color-muted);
    font-size: .65rem;
}

.table-actions {
    text-align: right !important;
    white-space: nowrap;
}

.table-actions .button + .button {
    margin-left: .3rem;
}

.button-small {
    min-height: 34px;
    padding: .42rem .66rem;
    border-radius: .55rem;
    font-size: .69rem;
}

.button-quiet {
    color: var(--color-muted);
    background: transparent;
    border-color: transparent;
}

.button-quiet:hover {
    color: var(--color-alert);
    background: #fff1f3;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-brand { color: var(--color-brand-dark); background: #f9e9e5; }
.status-success { color: #19613e; background: #e9f7ef; }
.status-warning { color: #815b0a; background: #fff6d9; }
.status-neutral { color: #59615d; background: #ecefed; }

.status-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    padding: .75rem 1rem;
    color: var(--color-muted);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: .8rem;
    font-size: .72rem;
    font-weight: 650;
}

.form-panel form,
.payment-panel form {
    padding: 1.15rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.form-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid label,
.inline-form label,
.form-panel form > label,
.payment-panel form label {
    display: flex;
    flex-direction: column;
    gap: .32rem;
}

.form-grid label > span,
.inline-form label > span,
.form-panel form > label > span,
.payment-panel form label > span {
    color: var(--color-muted);
    font-size: .7rem;
    font-weight: 800;
}

.check-field {
    flex-direction: row !important;
    align-items: center;
    margin-top: .9rem;
}

.check-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-brand);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: 1rem;
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    padding: 1rem 1.15rem;
    background: #fbfbfa;
    border-top: 1px solid var(--color-border);
}

.grow-field { flex: 1 1 auto; }
.quantity-field { flex: 0 0 90px; }
.align-field { flex: 0 0 auto; }

.note-box {
    margin: 0 1.15rem 1.15rem;
    padding: .8rem;
    color: #615751;
    background: var(--color-warm);
    border: 1px solid #f0ddd7;
    border-radius: .7rem;
}

.note-box strong {
    display: block;
    margin-bottom: .25rem;
    font-size: .72rem;
}

.note-box p {
    margin: 0;
    font-size: .74rem;
    white-space: pre-wrap;
}

.payment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
    gap: 1.5rem;
}

.checkout-summary {
    margin: 0;
    padding: .8rem 1rem;
    background: #fbfbfa;
    border: 1px solid var(--color-border);
    border-radius: .75rem;
}

.checkout-summary > div {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    padding: .45rem 0;
}

.checkout-summary dt { color: var(--color-muted); font-size: .72rem; }
.checkout-summary dd { margin: 0; font-size: .78rem; font-weight: 800; }
.checkout-summary .checkout-total { margin-top: .3rem; padding-top: .8rem; border-top: 2px solid var(--color-ink); }
.checkout-summary .checkout-total dt,
.checkout-summary .checkout-total dd { color: var(--color-ink); font-size: 1rem; font-weight: 800; }
.checkout-summary .no-charge-note { color: #19613e; }

.paid-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
}

.paid-summary > div:first-child {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.paid-summary > div:first-child > div { display: flex; flex-direction: column; }
.paid-summary small { color: var(--color-muted); }
.paid-mark { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #2c8a57; border-radius: 50%; font-weight: 900; }
.paid-total { margin-left: auto; font-size: 1.25rem; }

/* Print views */
.print-shell {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.print-document {
    padding: 2rem;
    color: #171c1a;
    background: #fff;
    border: 1px solid #d8d8d4;
    box-shadow: var(--shadow-card);
}

.print-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid var(--color-brand);
}

.print-header img { width: 112px; height: 70px; object-fit: contain; }
.print-header span { color: var(--color-brand); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.print-header h1 { margin: .1rem 0; font-size: 1.8rem; }
.print-header p { margin: 0; color: var(--color-muted); }

.receipt-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
}

.receipt-code-row > div { display: flex; flex-direction: column; }
.receipt-code-row span { color: var(--color-muted); font-size: .72rem; font-weight: 700; }
.receipt-code-row strong { font-size: 2.2rem; letter-spacing: .04em; }
.receipt-code-row small { color: var(--color-muted); }
.print-qr { width: 150px; height: 150px; image-rendering: crisp-edges; }

.print-details { margin: 0; border-top: 1px solid #ddd; }
.print-details > div { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid #e5e5e1; }
.print-details dt { color: #606863; font-size: .78rem; font-weight: 700; }
.print-details dd { margin: 0; font-weight: 650; }
.print-note { margin: 1.4rem 0; padding: .8rem; background: #fff7f4; border-left: 4px solid var(--color-brand); font-size: .8rem; }
.print-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid #ddd; color: #606863; font-size: .7rem; }
.print-actions { display: flex; justify-content: center; gap: .65rem; margin-top: 1rem; }

.device-label {
    width: 100mm;
    min-height: 50mm;
    display: grid;
    grid-template-columns: 1fr 38mm;
    gap: 5mm;
    padding: 6mm;
    color: #171c1a;
    background: #fff;
    border: 1.5px solid #171c1a;
}

.device-label .label-copy { min-width: 0; display: flex; flex-direction: column; }
.device-label .label-copy > span { color: var(--color-brand); font-size: 8pt; font-weight: 800; text-transform: uppercase; }
.device-label strong { margin: 2mm 0; font-size: 22pt; line-height: 1; letter-spacing: .04em; }
.device-label b { font-size: 11pt; }
.device-label small { display: -webkit-box; overflow: hidden; margin-top: 1mm; font-size: 8pt; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.device-label img { width: 36mm; height: 36mm; }

.print-table { width: 100%; margin-top: 1.2rem; border-collapse: collapse; }
.print-table th, .print-table td { padding: .55rem .4rem; border-bottom: 1px solid #ddd; text-align: left; font-size: .78rem; }
.print-table th:nth-child(n+2), .print-table td:nth-child(n+2) { text-align: right; }
.print-table tfoot th { text-align: right; }
.print-table .print-total th, .print-table .print-total td { border-top: 2px solid #171c1a; font-size: 1rem; }

@media (max-width: 900px) {
    .content-grid,
    .content-grid-two-thirds,
    .payment-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .form-grid,
    .form-grid-four { grid-template-columns: minmax(0, 1fr); }
    .inline-form { align-items: stretch; flex-direction: column; }
    .quantity-field { flex-basis: auto; }
    .paid-summary { align-items: stretch; flex-direction: column; }
    .paid-total { margin-left: 0; }
}

@media print {
    @page { margin: 10mm; }
    body { background: #fff !important; }
    .print-shell { width: 100%; margin: 0; padding: 0; }
    .print-document { padding: 0; border: 0; box-shadow: none; }
    .print-actions { display: none !important; }
    .device-label { break-inside: avoid; }
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (max-width: 1250px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card {
        min-height: 126px;
    }

    .quick-copy span {
        white-space: normal;
    }
}

@media (max-width: 980px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

@media (max-width: 640px) {
    .page-heading {
        gap: 1rem;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .button {
        flex: 1 1 0;
    }

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

    .metric-card {
        min-height: 116px;
    }

    .quick-card {
        min-height: 92px;
    }
}

@media (max-width: 420px) {
    .page-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .page-actions .button {
        width: 100%;
    }

    .metric-card {
        padding: 1rem;
    }

    .quick-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .quick-arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
