:root {
    --bg: #f4efe6;
    --surface: #fffdf8;
    --text: #24312b;
    --muted: #68746d;
    --line: #dfd4c4;
    --primary: #1e6b52;
    --primary-soft: #e2f2eb;
    --danger: #8f2d2d;
    --danger-soft: #f7e4e4;
    --success: #21613f;
    --success-soft: #e3f3e9;
    --shadow: 0 18px 50px rgba(66, 54, 38, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(185, 131, 50, 0.18), transparent 28%),
        radial-gradient(circle at left bottom, rgba(30, 107, 82, 0.16), transparent 32%),
        var(--bg);
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-size: 26px;
    font-weight: 800;
}

.user-badge {
    display: grid;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid rgba(223, 212, 196, 0.9);
    box-shadow: var(--shadow);
}

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

.page {
    max-width: 1460px;
    margin: 0 auto;
    padding: 20px;
}

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
}

.sidebar {
    position: sticky;
    top: 18px;
    align-self: start;
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(223, 212, 196, 0.9);
    box-shadow: var(--shadow);
}

.sidebar-mobile-head,
.mobile-menu-button,
.mobile-sidebar-backdrop {
    display: none;
}

.sidebar-brand {
    display: grid;
    gap: 8px;
}

.sidebar-user {
    box-shadow: none;
    background: #fffdfa;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-link {
    display: block;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(30, 107, 82, 0.18);
}

.sidebar-logout {
    margin-top: 8px;
}

.content-area {
    min-width: 0;
}

.app-shell > *,
.hero > *,
.hero-side > *,
.content-grid > *,
.stat-grid > *,
.page-head > *,
.panel-header > * {
    min-width: 0;
}

.page-section {
    display: grid;
    gap: 18px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    flex-wrap: wrap;
}

.page-head h1 {
    margin: 14px 0 10px;
    font-size: 32px;
    line-height: 1.12;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.hero-card,
.panel,
.stat-card {
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid rgba(223, 212, 196, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 28px;
    overflow: hidden;
}

.eyebrow {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero h1 {
    margin: 14px 0 10px;
    font-size: 34px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.hero p,
.small {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.button,
button {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    max-width: 100%;
}

.button-primary,
button[type="submit"] {
    background: var(--primary);
    color: #fff;
}

.button-secondary {
    background: var(--primary-soft);
    color: var(--primary);
}

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

button.button-secondary {
    background: var(--primary-soft);
    color: var(--primary);
}

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

.hero-side,
.stack {
    display: grid;
    gap: 18px;
}

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

.stat-card,
.panel {
    padding: 22px;
}

.stat-card {
    display: grid;
    gap: 12px;
    align-content: start;
    overflow: hidden;
}

.stat-card h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.stat-card strong {
    display: block;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    max-width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-size: clamp(1.7rem, 1.35rem + 0.85vw, 2.45rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.metric-value-plain {
    gap: 0;
}

.metric-prefix {
    flex: 0 0 auto;
}

.metric-number {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.metric-value-plain .metric-number {
    width: 100%;
    overflow: visible;
    text-overflow: clip;
}

.dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.dashboard-stat-card {
    min-height: 150px;
}

.dashboard-stat-card .metric-value {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
    row-gap: 2px;
    white-space: normal;
    font-size: clamp(1.35rem, 1rem + 0.75vw, 2rem);
    line-height: 1.02;
}

.dashboard-stat-card .metric-value-plain {
    grid-template-columns: 1fr;
}

.dashboard-stat-card .metric-prefix,
.dashboard-stat-card .metric-number {
    white-space: normal;
}

.dashboard-stat-card .metric-prefix {
    align-self: start;
}

.dashboard-stat-card .metric-number {
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: normal;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr;
    gap: 18px;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 22px;
}

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

.panel-header p {
    margin: 0;
    color: var(--muted);
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

.flash-success {
    background: var(--success-soft);
    color: var(--success);
}

.flash-error {
    background: var(--danger-soft);
    color: var(--danger);
}

form,
label {
    display: grid;
    gap: 10px;
}

.inline-form {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdfa;
}

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

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

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

.field-grid-search {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(180px, 0.8fr) auto;
    align-items: end;
}

label {
    font-weight: 600;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
    font: inherit;
}

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

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(223, 212, 196, 0.8);
    vertical-align: top;
    overflow-wrap: break-word;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #f5eee2;
    color: #81591d;
    max-width: 100%;
    white-space: normal;
}

.progress-box {
    min-width: 180px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    font-size: 13px;
    color: var(--muted);
}

.progress-bar {
    height: 10px;
    width: 100%;
    background: #ecdfcb;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b98332, #1e6b52);
}

.empty {
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
}

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

.public-shell {
    min-height: calc(100vh - 80px);
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.public-card {
    width: min(1080px, 100%);
}

.public-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 18px;
}

.auth-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 26px;
    border: 1px solid rgba(223, 212, 196, 0.9);
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 14px 0 10px;
    line-height: 1.15;
}

.panel-soft {
    margin-top: 16px;
    background: #faf6ef;
    box-shadow: none;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.stack-tight {
    display: grid;
    gap: 14px;
}

.quick-report-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.align-end {
    display: flex;
    align-items: end;
}

.role-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.role-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}

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

.permission-item {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.permission-item input {
    width: auto;
    margin-top: 3px;
}

.permission-item span {
    display: grid;
    gap: 4px;
}

.permission-item small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.badge-soft {
    background: var(--primary-soft);
    color: var(--primary);
}

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

.badge-warning {
    background: #f6ebd7;
    color: #9b6b18;
}

.badge-muted {
    background: #ece7df;
    color: #6a665f;
}

.message-template {
    min-height: 150px;
}

.message-preview {
    min-width: 240px;
    max-width: 360px;
    white-space: normal;
    line-height: 1.5;
    color: var(--muted);
}

.copy-link-input {
    margin-top: 8px;
    min-width: 240px;
    font-size: 12px;
}

body.has-modal-open {
    overflow: hidden;
}

.modal-dialog {
    width: min(820px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: auto;
    border: 1px solid rgba(223, 212, 196, 0.9);
    padding: 22px;
}

.modal-dialog:not([open]) {
    display: none;
}

.modal-dialog::backdrop {
    background: rgba(25, 31, 28, 0.45);
}

.modal-header {
    margin-bottom: 18px;
}

.modal-form {
    gap: 14px;
}

.modal-actions {
    display: flex;
    justify-content: end;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-close {
    flex: 0 0 auto;
}

.participant-table {
    min-width: 980px;
    table-layout: auto;
}

.participant-table th,
.participant-table td {
    overflow-wrap: normal;
    word-break: normal;
}

.participant-col-id {
    width: 72px;
    min-width: 72px;
}

.participant-col-name {
    min-width: 220px;
}

.participant-col-info {
    min-width: 230px;
}

.participant-col-status {
    min-width: 120px;
}

.participant-col-progress {
    min-width: 240px;
}

.participant-col-link {
    min-width: 290px;
}

.participant-col-action {
    min-width: 120px;
}

.participant-col-link .button {
    min-width: 128px;
}

.participant-col-link .copy-link-input {
    width: 100%;
}

.participant-edit-button {
    width: 100%;
}

.participant-inline-form {
    gap: 0;
}

.participant-filter-form {
    gap: 0;
}

.participant-filter-actions {
    gap: 10px;
    flex-wrap: wrap;
}

.action-stack {
    display: grid;
    gap: 8px;
}

.payment-overview {
    gap: 14px;
}

.payment-create-panel {
    padding-bottom: 20px;
}

.payment-create-header {
    align-items: center;
}

.payment-create-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-stat-grid {
    max-width: 560px;
}

.payment-table {
    min-width: 960px;
    table-layout: auto;
}

.payment-table th,
.payment-table td {
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: top;
}

.payment-col-date {
    min-width: 110px;
}

.payment-col-name {
    min-width: 180px;
}

.payment-col-amount {
    min-width: 130px;
}

.payment-col-source {
    min-width: 92px;
}

.payment-col-operator {
    min-width: 120px;
}

.payment-col-notes {
    min-width: 170px;
    white-space: normal;
}

.payment-col-action {
    min-width: 148px;
}

.payment-action-stack {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.payment-action-stack form {
    display: contents;
}

.payment-action-button {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    text-align: center;
}

.dashboard-insight-grid {
    margin-bottom: 18px;
}

.dashboard-filter-form {
    display: flex;
    align-items: end;
}

.dashboard-participant-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.dashboard-filter-form label {
    min-width: 180px;
}

.dashboard-participant-panel {
    width: 100%;
}

.dashboard-participant-table {
    min-width: 820px;
}

.dashboard-col-id {
    min-width: 72px;
}

.dashboard-col-name {
    min-width: 260px;
}

.dashboard-col-status {
    min-width: 130px;
}

.dashboard-col-balance {
    min-width: 140px;
}

.dashboard-col-input {
    min-width: 120px;
}

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

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

.receipt-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.payment-receipt-panel {
    margin-top: -2px;
}

.payment-receipt-panel .hero-actions {
    margin-top: 0;
}

.receipt-print-card {
    display: grid;
    gap: 18px;
}

.receipt-print-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.receipt-print-header h2 {
    margin: 0 0 6px;
}

.receipt-print-meta {
    display: grid;
    gap: 6px;
}

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

.receipt-print-item,
.receipt-print-note {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.receipt-print-note {
    min-height: 96px;
}

.receipt-voucher {
    display: grid;
    gap: 22px;
    padding: 26px;
    border: 2px dashed #ccb792;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 246, 239, 0.98)),
        #fffdfa;
}

.receipt-voucher-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.receipt-voucher-brand {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.receipt-voucher-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 15px;
}

.receipt-voucher-number-box {
    min-width: 220px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.receipt-voucher-body {
    display: grid;
    gap: 16px;
}

.receipt-voucher-row {
    display: grid;
    gap: 8px;
}

.receipt-voucher-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.receipt-voucher-value,
.receipt-voucher-words {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    line-height: 1.6;
}

.receipt-voucher-words {
    font-style: italic;
}

.receipt-voucher-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, #1e6b52, #2d8767);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.receipt-voucher-amount span {
    font-size: 28px;
    font-weight: 700;
}

.receipt-voucher-amount strong {
    font-size: clamp(2rem, 1.4rem + 1.4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.receipt-voucher-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.receipt-voucher-meta-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.receipt-voucher-note {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    min-height: 86px;
}

.receipt-voucher-foot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding-top: 10px;
}

.receipt-sign-box {
    display: grid;
    gap: 12px;
    justify-items: center;
    text-align: center;
}

.receipt-sign-line {
    width: 100%;
    max-width: 220px;
    height: 58px;
    border-bottom: 2px solid var(--line);
}

.receipt-classic-sheet {
    display: grid;
    place-items: center;
}

.receipt-classic {
    width: min(185mm, 100%);
    min-height: 132mm;
    padding: 12mm 14mm;
    font-family: "Times New Roman", Times, serif;
    color: #111;
    background: #fff;
    border: 1px solid #d8d8d8;
}

.receipt-classic-title {
    margin-bottom: 14mm;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    text-decoration: underline;
    letter-spacing: 0.02em;
}

.receipt-classic-table {
    display: grid;
    gap: 10px;
}

.receipt-classic-row {
    display: grid;
    grid-template-columns: 220px 24px minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    font-size: 18px;
    line-height: 1.45;
}

.receipt-classic-row.nested {
    grid-template-columns: 220px 24px minmax(0, 1fr);
    margin-left: 220px;
}

.receipt-classic-label,
.receipt-classic-sep {
    white-space: nowrap;
}

.receipt-classic-value {
    min-height: 1.5em;
}

.receipt-classic-value.dotted {
    border-bottom: 3px dotted #222;
    padding-bottom: 4px;
}

.receipt-classic-signature {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 18px;
    align-items: end;
    margin-top: 24mm;
    font-size: 18px;
}

.receipt-classic-sign-line {
    height: 1.5em;
    border-bottom: 3px dotted #222;
}

.receipt-classic-footer {
    margin: 18mm auto 0;
    max-width: 150mm;
    padding: 10px 14px;
    border: 2px solid #222;
    text-align: center;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.receipt-classic-footer strong,
.receipt-classic-footer span {
    display: block;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 240px;
}

.chart-column {
    display: grid;
    gap: 10px;
    align-items: end;
}

.chart-column-value {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.chart-column-track {
    height: 150px;
    border-radius: 18px;
    background: #efe3d1;
    position: relative;
    overflow: hidden;
}

.chart-column-fill {
    position: absolute;
    inset: auto 0 0 0;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, #1e6b52 0%, #b98332 100%);
}

.chart-column-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.chart-row {
    display: grid;
    gap: 8px;
}

.chart-row-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.chart-bar-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #efe3d1;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 999px;
}

.chart-bar-fill.status-active {
    background: linear-gradient(90deg, #d49a3c, #b98332);
}

.chart-bar-fill.status-completed {
    background: linear-gradient(90deg, #3f955c, #21613f);
}

.chart-bar-fill.status-overpaid {
    background: linear-gradient(90deg, #2a8c70, #1e6b52);
}

.chart-bar-fill.status-archived {
    background: linear-gradient(90deg, #8f877b, #6a665f);
}

.report-shell {
    display: grid;
    gap: 18px;
}

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

.report-paper {
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(223, 212, 196, 0.9);
}

.report-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.report-header h2 {
    margin: 0 0 6px;
    font-size: 28px;
}

.report-header p {
    margin: 0;
    color: var(--muted);
}

.report-stats {
    margin-bottom: 18px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.report-section {
    box-shadow: none;
    border: 1px solid var(--line);
    background: #fffdfa;
}

.panel,
.inline-form,
.role-card,
.quick-report-card,
.report-paper,
.report-section,
.auth-card {
    overflow: hidden;
}

code.inline {
    background: #f1eadf;
    border-radius: 8px;
    padding: 3px 7px;
}

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

    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
        gap: 5px;
        width: 52px;
        height: 52px;
        position: sticky;
        top: 14px;
        z-index: 120;
        border: 1px solid rgba(223, 212, 196, 0.9);
        border-radius: 16px;
        background: rgba(255, 253, 248, 0.96);
        box-shadow: var(--shadow);
        cursor: pointer;
        padding: 0;
    }

    .mobile-menu-button span {
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 999px;
        background: var(--text);
    }

    .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 105;
        border: 0;
        background: rgba(22, 29, 26, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 40px));
        max-width: 100%;
        border-radius: 0 24px 24px 0;
        z-index: 130;
        overflow-y: auto;
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.24s ease;
    }

    .sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 6px;
        border-bottom: 1px solid rgba(223, 212, 196, 0.9);
    }

    .mobile-menu-close {
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }

    body.has-mobile-menu-open {
        overflow: hidden;
    }

    body.has-mobile-menu-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.has-mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .content-area {
        padding-top: 2px;
    }

    .hero,
    .content-grid,
    .public-grid {
        grid-template-columns: 1fr;
    }

    .field-grid-3,
    .field-grid-4,
    .field-grid-search,
    .permission-grid,
    .report-toolbar {
        grid-template-columns: 1fr;
    }

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

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

    .dashboard-activity-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: clamp(1.45rem, 1.2rem + 0.8vw, 2rem);
    }
}

@media (max-width: 720px) {
    .page {
        padding: 14px;
    }

    .page-head,
    .role-card-head,
    .report-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .field-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

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

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

    .dashboard-filter-form {
        width: 100%;
    }

    .dashboard-participant-header-actions {
        width: 100%;
    }

    .dashboard-filter-form label {
        width: 100%;
    }

    .participant-table,
    .dashboard-participant-table,
    .payment-table {
        min-width: 0;
    }

    .participant-table thead,
    .dashboard-participant-table thead,
    .payment-table thead {
        display: none;
    }

    .participant-table tbody,
    .dashboard-participant-table tbody,
    .payment-table tbody {
        display: grid;
        gap: 14px;
    }

    .participant-table tr,
    .dashboard-participant-table tr,
    .payment-table tr {
        display: grid;
        gap: 10px;
        padding: 16px;
        border: 1px solid rgba(223, 212, 196, 0.8);
        border-radius: 18px;
        background: #fffdfa;
    }

    .participant-table td,
    .dashboard-participant-table td,
    .payment-table td {
        display: grid;
        grid-template-columns: minmax(92px, 110px) minmax(0, 1fr);
        gap: 10px;
        padding: 0;
        border-bottom: none;
        align-items: start;
    }

    .participant-table td::before,
    .dashboard-participant-table td::before,
    .payment-table td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--muted);
        letter-spacing: 0.03em;
    }

    .participant-col-progress .progress-box {
        min-width: 0;
    }

    .participant-col-link .copy-link-input {
        min-width: 0;
    }

    .dashboard-participant-header-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payment-col-action {
        min-width: 0;
    }

    .payment-action-stack {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .payment-stat-grid {
        max-width: none;
    }

    .receipt-grid,
    .receipt-print-grid {
        grid-template-columns: 1fr;
    }

    .receipt-voucher {
        padding: 18px;
    }

    .receipt-voucher-head,
    .receipt-voucher-foot,
    .receipt-voucher-meta-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .receipt-voucher-number-box {
        min-width: 0;
    }

    .receipt-voucher-amount {
        flex-direction: column;
        align-items: start;
    }

    .receipt-classic {
        width: 100%;
        min-height: 0;
        padding: 22px 18px;
    }

    .receipt-classic-title {
        margin-bottom: 24px;
        font-size: 24px;
    }

    .receipt-classic-row,
    .receipt-classic-row.nested,
    .receipt-classic-signature {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-left: 0;
        font-size: 16px;
    }

    .receipt-classic-signature {
        margin-top: 30px;
    }

    .receipt-classic-footer {
        margin-top: 24px;
        max-width: none;
    }

    .receipt-print-header {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero-side .stat-card {
        min-height: 0;
    }

    .hero h1 {
        font-size: 28px;
    }

    .metric-value {
        display: grid;
        gap: 2px;
        white-space: normal;
        font-size: clamp(1.2rem, 1rem + 1vw, 1.65rem);
        line-height: 1.02;
    }

    .metric-prefix,
    .metric-number {
        white-space: normal;
    }

    .metric-number {
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .dashboard-stat-card .metric-value {
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 6px;
        row-gap: 0;
        font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.55rem);
    }

    .dashboard-stat-card .metric-value-plain {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        width: calc(100% - 28px);
        max-height: calc(100vh - 28px);
        padding: 18px;
    }

    .modal-actions {
        justify-content: stretch;
    }

    .modal-actions .button,
    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }

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

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

    .page {
        max-width: 100%;
        padding: 0;
    }

    .sidebar,
    .no-print,
    .report-meta {
        display: none !important;
    }

    .report-paper,
    .panel,
    .stat-card,
    .report-section {
        box-shadow: none;
        border: none;
        background: #fff;
    }

    .report-paper {
        padding: 0;
    }

    .receipt-print-card,
    .receipt-print-item,
    .receipt-print-note,
    .receipt-voucher,
    .receipt-voucher-value,
    .receipt-voucher-words,
    .receipt-voucher-meta-card,
    .receipt-voucher-note,
    .receipt-voucher-number-box,
    .receipt-classic {
        border-color: #d6d6d6;
        background: #fff;
    }

    .receipt-voucher {
        box-shadow: none;
    }

    .receipt-classic {
        width: 185mm;
        min-height: 132mm;
        margin: 0 auto;
        padding: 10mm 12mm;
        border: 1px solid #bdbdbd;
    }

    .receipt-classic-title {
        margin-bottom: 10mm;
        font-size: 21px;
    }

    .receipt-classic-row {
        grid-template-columns: 48mm 6mm 1fr;
        gap: 6px;
        font-size: 14px;
    }

    .receipt-classic-row.nested {
        grid-template-columns: 48mm 6mm 1fr;
        margin-left: 48mm;
    }

    .receipt-classic-value {
        min-height: 1.3em;
    }

    .receipt-classic-value.dotted,
    .receipt-classic-sign-line {
        border-bottom-width: 2px;
    }

    .receipt-classic-signature {
        grid-template-columns: 78mm 1fr;
        gap: 8px;
        margin-top: 14mm;
        font-size: 14px;
    }

    .receipt-classic-footer {
        margin-top: 10mm;
        max-width: 140mm;
        padding: 8px 10px;
        border-width: 1px;
        font-size: 11px;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 8px 6px;
    }
}
