:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #253246;
    --muted: #6f7b8d;
    --line: #dce2ea;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b42318;
    --success: #147a3f;
    --warning: #a15c00;
    --shadow: 0 12px 30px rgba(24, 33, 47, 0.08);
}
.mr-3 {
    margin-right: 12px;
}
* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-weight: 500;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    background: #172436;
    color: #fff;
    padding: 24px 18px;
    min-width: 0;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary);
    font-weight: 700;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 3px;
    color: #aeb8c4;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: #aeb8c4;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    letter-spacing: 0;
}

.nav i {
    width: 18px;
    color: #718092;
    text-align: center;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f8fb;
}

.nav a:hover i {
    color: #8fd5cd;
}

.nav a.is-active {
    color: #ffffff;
    font-weight: 700;
}

.nav a.is-active i {
    color: #8fd5cd;
}

.muted-link {
    opacity: 0.6;
}

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

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

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.user-menu span,
.user-menu a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.user-menu a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

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

.metric-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.metric-card {
    padding: 18px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-left: 2px solid var(--card-accent, var(--line));
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto auto;
    width: 100%;
    height: 42px;
    background: color-mix(
        in srgb,
        var(--card-accent, var(--primary)) 12%,
        transparent
    );
    border-radius: 0 8px 0 80px;
    pointer-events: none;
    z-index: 0;
}

.metric-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.metric-card-top > span {
    color: var(--muted);
    font-size: 14px;
}

.metric-card-top > i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--card-accent, var(--primary));
    background: color-mix(
        in srgb,
        var(--card-accent, var(--primary)) 12%,
        #fff
    );
    font-size: 20px;
    flex: 0 0 auto;
}

.metric-card--cash {
    --card-accent: #0f766e;
}

.metric-card--value {
    --card-accent: #4f46e5;
}

.metric-card--receivable {
    --card-accent: #15803d;
}

.metric-card--payable {
    --card-accent: #b42318;
}

.metric-card--stock {
    --card-accent: #a15c00;
}

.metric-card--stock-value {
    --card-accent: #0369a1;
}

.metric-card--avg {
    --card-accent: #7c3aed;
}

.metric-card--today {
    --card-accent: #c2410c;
}
.todays_stats_wrapper {
    display: flex;
    flex-direction: column;
}
.overall_averages_stats_wrapper > div,
.todays_stats_wrapper > div {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-weight: 500;
}

.overall_averages_stats_wrapper,
.todays_stats_wrapper {
    position: relative;
    z-index: 1;
}
.overall_averages .money-currency {
    display: none;
}

.metric-card > span {
    color: var(--muted);
    font-size: 14px;
}

.metric-card strong {
    font-size: 24px;
    line-height: 1.25;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.metric-card strong .money,
.metric-card strong .money-value,
.overall_averages_stats_wrapper .money,
.overall_averages_stats_wrapper .money-value,
.todays_stats_wrapper .money,
.todays_stats_wrapper .money-value {
    font-weight: 600;
}

.money {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.rate-kg {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

.rate-label {
    color: var(--muted);
    font-size: 0.58em;
    font-weight: 500;
    text-transform: none;
}

.money-currency,
.avg_label {
    color: var(--muted);
    font-size: 0.58em;
    font-weight: 500;
    text-transform: uppercase;
}

.money-comma {
    color: var(--muted);
    font-size: 0.72em;
    font-weight: 500;
}

.money-flow {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 3px;
    font-weight: inherit;
    letter-spacing: 0;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.money-flow .money-currency {
    color: inherit;
    font-weight: inherit;
}

.money-flow--in {
    color: inherit;
}

.money-flow--out {
    color: inherit;
}

.money-flow--in .money-comma,
.money-flow--in .money-currency {
    color: inherit;
}

.money-flow--out .money-comma,
.money-flow--out .money-currency {
    color: inherit;
}

tr.money-row--in td {
    color: #147a3f;
}

tr.money-row--out td {
    color: #b42318;
}

.avg_label {
    margin-left: 2px;
}

.metric-card small {
    color: var(--muted);
    font-size: 13px;
}

.metric-card.muted {
    background: #fdfbf6;
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.panel.narrow,
.auth-panel {
    max-width: 520px;
}

.setup-panel {
    max-width: 920px;
}

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

.section-heading h2,
.panel h2 {
    margin: 0;
    font-size: 20px;
}

.section-heading p,
.panel .soft {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.6px;
}

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

.form-grid.compact-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
    align-items: end;
}

.form-grid.compact-form .form-actions {
    grid-column: auto;
    flex-wrap: wrap;
    align-self: end;
}

.report-filter-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.35fr);
    align-items: end;
    gap: 18px;
}

.report-date-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
    gap: 16px;
}

.report-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.report-actions .button {
    min-width: 0;
}

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

.action-picker {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    align-items: end;
    gap: 12px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #465468;
    font-size: 14px;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: end;
    min-height: 42px;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd3dd;
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    background: #fff;
}

input::placeholder,
textarea::placeholder {
    color: #9aa5b5;
    font-weight: 400;
    opacity: 1;
}

select {
    appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #687384 50%),
        linear-gradient(135deg, #687384 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size:
        6px 6px,
        6px 6px;
    background-repeat: no-repeat;
}

input[type="date"],
input[data-date-picker] {
    min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.16);
    border-color: var(--primary);
}

.form-actions,
.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions {
    grid-column: 1 / -1;
    margin-top: 6px;
}

.button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    gap: 8px;
    text-wrap: nowrap;
    text-transform: capitalize;
    letter-spacing: 0.6px;
}

.button.small {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

.button.primary {
    color: #fff;
    background: var(--primary);
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.secondary {
    color: var(--primary-dark);
    background: #e7f5f3;
    border: 1px solid #b9e4de;
}

.button.danger {
    color: var(--danger);
    background: #fff1f0;
    border: 1px solid #ffd0cc;
}

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

.alert,
.notice {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.alert p {
    margin: 0;
}

.alert.error {
    background: #fff1f0;
    color: var(--danger);
    border: 1px solid #ffd0cc;
}

.alert.success {
    background: #edfdf3;
    color: var(--success);
    border: 1px solid #c6f1d6;
}

.notice {
    display: grid;
    gap: 5px;
    background: #fff8e8;
    color: var(--warning);
    border: 1px solid #ffe0a3;
}

.danger-panel {
    border-color: #ffd0cc;
}

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

.table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.rows-select {
    max-width: 140px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.pagination .is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.table-footer {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #fbfcfe;
}

.table-wrap + .table-footer {
    margin-top: -1px;
}

.table-wrap:has(+ .table-footer) {
    border-radius: 8px 8px 0 0;
}

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

.table-footer-count {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.table-footer .pagination {
    justify-content: flex-end;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
    background: #fff;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th {
    background: #f8fafc;
    color: #425064;
    font-size: 13px;
}

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

.empty {
    color: var(--muted);
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 8px;
    background: #eef2f6;
    color: #425064;
    font-size: 13px;
    font-weight: 600;
}

.badge.success {
    background: #edfdf3;
    color: var(--success);
}

.badge.danger {
    background: #fff1f0;
    color: var(--danger);
}

.table-action {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--primary-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

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

.details-row[hidden],
.app-modal[aria-hidden="true"] {
    display: none;
}

.details-row td {
    background: #fbfcfe;
    white-space: normal;
}

.row-detail-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 4px 0;
}

.row-detail-panel--compact {
    grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
}

.row-detail-panel--statement {
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
}

.row-detail-item {
    display: grid;
    gap: 4px;
}

.row-detail-item--wide {
    grid-column: span 1;
}

.row-detail-item span {
    color: var(--muted);
    font-size: 12px;
}

.row-detail-item strong {
    font-size: 14px;
    font-weight: 500;
}

.row-detail-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 6px;
}

body.modal-open {
    overflow: hidden;
}

.app-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(23, 36, 54, 0.48);
}

.app-modal__dialog {
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(23, 36, 54, 0.24);
    padding: 22px;
}

.app-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.app-modal__header h3 {
    margin: 0;
    font-size: 18px;
}

.app-modal__header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.icon-button {
    width: 36px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
}

.table-toggle {
    width: 28px;
    min-height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.table-toggle:hover {
    color: var(--primary-dark);
}

.table-toggle i {
    transition: transform 0.2s ease;
}

.table-toggle.is-expanded i {
    transform: rotate(180deg);
}

.detail-toggle-table th:last-child,
.detail-toggle-table td:last-child {
    width: 72px;
    text-align: center;
}

.statement-details-row td {
    color: var(--ink);
}

.is-hidden {
    display: none;
}

.print-only {
    display: none;
}

.print-footer {
    display: none;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.print-body {
    background: #e9edf2;
}

.print-document {
    width: min(820px, calc(100% - 32px));
    margin: 24px auto;
    padding: 34px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.print-header,
.print-title,
.print-meta,
.print-signatures {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.print-header {
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ink);
}

.print-header h1,
.print-title h2 {
    margin: 0;
}

.print-header p,
.print-title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.print-title {
    align-items: center;
    padding: 22px 0;
}

.print-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.print-meta div,
.print-lines div,
.print-notes {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.print-meta span,
.print-lines span,
.print-notes span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

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

.print-breakdown {
    margin-top: 14px;
}

.print-breakdown h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.print-breakdown table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.print-breakdown th,
.print-breakdown td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

.print-breakdown th {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}

.print-notes {
    margin-top: 12px;
}

.print-notes p {
    margin: 0;
}

.print-signatures {
    margin-top: 48px;
}

.print-signatures div {
    width: 42%;
    padding-top: 12px;
    border-top: 1px solid var(--ink);
    color: var(--muted);
}

.print-footer.visible {
    display: block;
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.inline-form {
    display: grid;
    grid-template-columns: 140px 110px minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    min-height: 36px;
    padding: 7px 9px;
}

.partner-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
    gap: 16px;
    align-items: start;
}

.partner-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fbfcfe;
}

.partner-add-form {
    margin-bottom: 14px;
}

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

.partner-list-row,
.withdrawal-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.partner-list-row:first-child,
.withdrawal-preview-row:first-of-type {
    border-top: 0;
}

.partner-list-row strong,
.withdrawal-preview-row strong {
    display: block;
    font-weight: 600;
}

.partner-list-row span,
.withdrawal-preview-row span,
.withdrawal-preview__head span {
    color: var(--muted);
    font-size: 13px;
}

.withdrawal-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.withdrawal-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.withdrawal-preview-row input {
    max-width: 130px;
    min-height: 36px;
}

.withdrawal-preview-row input:disabled {
    display: none;
}

.withdrawal-preview-row > span:last-child {
    min-width: 92px;
    color: var(--ink);
    font-weight: 600;
    text-align: right;
}

.partner-history-heading {
    margin-top: 18px;
}

.partner-history-table td {
    vertical-align: middle;
}

.partner-history-table .amount-out {
    color: var(--danger);
}

.amount-in {
    color: var(--success);
}

.partner-breakdown {
    display: grid;
    gap: 5px;
    white-space: normal;
}

.partner-breakdown div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    max-width: 260px;
}

.partner-breakdown span {
    color: var(--muted);
    font-size: 13px;
}

.partner-breakdown strong {
    font-weight: 500;
    color: var(--ink);
}

.dues-table {
    min-width: 0;
    table-layout: fixed;
}

.dues-table th,
.dues-table td {
    white-space: normal;
}

.dues-table th:nth-child(1),
.dues-table td:nth-child(1) {
    width: 28%;
}

.dues-table th:nth-child(2),
.dues-table td:nth-child(2) {
    width: 24%;
}

.dues-table th:nth-child(3),
.dues-table td:nth-child(3) {
    width: 18%;
}

.dues-table th:nth-child(4),
.dues-table td:nth-child(4) {
    width: 18%;
}

.dues-table th:nth-child(5),
.dues-table td:nth-child(5) {
    width: 12%;
}

.setup-form .due-section {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.section-heading.compact {
    margin-bottom: 12px;
}

.section-heading.compact h2 {
    font-size: 18px;
}

.section-heading.compact p {
    font-size: 12px;
}

.due-rows {
    display: grid;
    gap: 10px;
}

.due-row {
    display: grid;
    grid-template-columns:
        minmax(160px, 1.2fr) minmax(120px, 0.8fr) minmax(140px, 0.8fr)
        minmax(180px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.due-total {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    color: var(--muted);
}

.due-total strong {
    color: var(--ink);
}

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

    .sidebar {
        padding: 16px;
    }

    .nav {
        grid-template-columns: repeat(5, max-content);
        overflow-x: auto;
    }

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

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

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

    .report-filter-form {
        grid-template-columns: 1fr;
    }

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

    .report-actions {
        justify-content: flex-start;
    }

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

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .app-shell {
        display: block;
    }

    .sidebar,
    .topbar,
    .no-print,
    script {
        display: none;
    }

    .main {
        padding: 0;
    }

    .print-body {
        background: #fff;
    }

    .print-document {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .panel,
    .metric-card {
        box-shadow: none;
        border-color: #c8c8c8;
        break-inside: avoid;
    }

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

    .table-wrap {
        overflow: visible;
    }

    table {
        min-width: 0;
        font-size: 11px;
    }

    th,
    td {
        padding: 6px;
        white-space: normal;
    }

    .print-only,
    .print-footer {
        display: block;
    }

    .print-footer {
        margin-top: 24px;
        border-top: 1px solid #c8c8c8;
        padding-top: 8px;
    }
}

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

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

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

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

    .report-date-fields {
        grid-template-columns: 1fr;
    }

    .action-picker {
        grid-template-columns: 1fr;
    }

    .withdrawal-preview-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .withdrawal-preview-row input {
        max-width: none;
    }

    .withdrawal-preview-row > span:last-child {
        min-width: 0;
        text-align: left;
    }

    .table-footer {
        grid-template-columns: 1fr;
    }

    .rows-form,
    .table-footer .pagination {
        justify-content: center;
    }

    .report-actions .button {
        flex: 1 1 calc(50% - 10px);
    }

    .metric-card {
        min-height: 104px;
        padding: 14px;
    }

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

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

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

    .dues-table {
        font-size: 12px;
    }

    .dues-table th,
    .dues-table td {
        padding: 9px 8px;
    }

    .metric-card strong {
        font-size: 19px;
    }

    .section-heading.compact {
        flex-direction: column;
    }

    .due-row {
        grid-template-columns: 1fr;
    }

    .backup-grid {
        grid-template-columns: 1fr;
    }
}
