:root {
    --ink: #0B2C2F;
    --muted: #5F7477;
    --line: #DCE8E9;
    --soft: #F4F8F8;
    --white: #FFFFFF;
    --brand: #006D77;
    --brand-dark: #004E56;
    --accent: #E9C46A;
    --success: #2A9D8F;
    --danger: #D85A3B;
    --warning: #B7791F;
    --shadow: 0 18px 48px rgba(7, 48, 54, 0.11);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #F7FAFA;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

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

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

img {
    max-width: 100%;
}

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

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.app-nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--brand);
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.brand img {
    width: 154px;
    height: auto;
    object-fit: contain;
}

.brand span {
    display: none;
}

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

.app-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 24px 56px;
}

.page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-kicker {
    margin-bottom: 8px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.page-title {
    margin-bottom: 10px;
    font-size: 36px;
    line-height: 1.12;
    letter-spacing: 0;
}

.page-lead {
    max-width: 680px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--brand);
    color: var(--white);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover,
.btn:focus,
button:hover,
button:focus {
    background: var(--brand-dark);
    color: var(--white);
    box-shadow: 0 10px 24px rgba(0, 109, 119, 0.20);
    transform: translateY(-1px);
}

.btn.secondary,
button.secondary,
.btn.btn-secondary {
    background: var(--white);
    color: var(--brand);
    border-color: var(--line);
}

.btn.secondary:hover,
.btn.secondary:focus,
button.secondary:hover,
button.secondary:focus,
.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
    background: var(--soft);
    color: var(--brand-dark);
    border-color: #BED5D7;
    box-shadow: none;
}

.btn.danger,
button.danger {
    background: #FFF0EC;
    color: var(--danger);
    border-color: #F4C9BE;
}

.btn.danger:hover,
.btn.danger:focus,
button.danger:hover,
button.danger:focus {
    background: #FFE3DC;
    color: #A83D26;
    box-shadow: none;
}

.btn.full,
button.full {
    width: 100%;
}

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

.stat-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
}

.stat-note {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.toolbar strong {
    display: block;
    margin-bottom: 4px;
}

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

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, auto));
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.filter-bar .form-group {
    margin-bottom: 0;
}

select {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #D4E1E2;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
}

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.receipt-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 8px 26px rgba(7, 48, 54, 0.06);
}

.receipt-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
}

.receipt-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.receipt-card-body {
    padding: 18px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.receipt-card h3 {
    margin-bottom: 12px;
    font-size: 20px;
    line-height: 1.25;
}

.receipt-meta {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.receipt-meta div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #EEF4F4;
    padding-bottom: 8px;
}

.receipt-meta div:last-child {
    border-bottom: 0;
}

.receipt-meta strong {
    color: var(--ink);
}

.receipt-amount {
    margin-top: 16px;
    font-size: 24px;
    font-weight: 800;
}

.receipt-footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #E5F2F3;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.pill.success {
    background: rgba(42, 157, 143, 0.13);
    color: #197568;
}

.pill.warning {
    background: #FFF4D8;
    color: var(--warning);
}

.pill.danger {
    background: #FFF0EC;
    color: var(--danger);
}

.empty-state {
    padding: 44px 24px;
    border: 1px dashed #B7D1D3;
    border-radius: 8px;
    background: var(--white);
    text-align: center;
}

.empty-state h2 {
    margin-bottom: 10px;
}

.empty-state p {
    max-width: 520px;
    margin: 0 auto 20px;
    color: var(--muted);
    line-height: 1.6;
}

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

.form-layout.single {
    grid-template-columns: minmax(0, 760px);
}

.panel {
    padding: 24px;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h2,
.panel-header h3 {
    margin-bottom: 8px;
}

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

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

.form-group {
    margin-bottom: 18px;
}

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

label,
.field-label {
    display: block;
    margin-bottom: 7px;
    color: #486569;
    font-size: 13px;
    font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #D4E1E2;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="file"] {
    padding: 10px;
    color: var(--muted);
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.11);
}

.field-help {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    cursor: pointer;
}

.checkbox-card input {
    width: auto;
    margin-top: 2px;
}

.checkbox-card > span,
.checkbox-card strong,
.checkbox-card > span > span {
    display: block;
}

.checkbox-card strong {
    color: var(--ink);
}

.checkbox-card > span > span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.upload-stack {
    display: grid;
    gap: 10px;
}

.upload-stack input + input {
    margin-top: 0;
}

.side-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.mt-18 {
    margin-top: 18px;
}

.mt-22 {
    margin-top: 22px;
}

.summary-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EEF4F4;
    color: var(--muted);
}

.summary-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.summary-list strong {
    color: var(--ink);
    text-align: right;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--soft);
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: zoom-in;
}

.image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(11, 44, 47, 0.82);
    color: var(--white);
    font-weight: 800;
}

.upload-inline {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.danger-zone {
    border-color: #F4C9BE;
    background: #FFF8F6;
}

.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 19, 21, 0.92);
}

.gallery-modal img {
    max-width: min(1100px, 94vw);
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.container {
    max-width: 430px;
    margin: 80px auto;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.container h1,
.container h2 {
    margin-bottom: 20px;
}

.container button {
    width: 100%;
}

.container input {
    margin-bottom: 15px;
}

.site-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}

.site-footer nav {
    display: flex;
    gap: 14px;
}

.consent-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    width: min(560px, calc(100vw - 36px));
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.consent-banner[hidden] {
    display: none;
}

.consent-banner p {
    margin: 6px 0 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.consent-actions {
    display: grid;
    gap: 8px;
}

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

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

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

    .toolbar,
    .filter-bar,
    .consent-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-bar,
    .consent-banner {
        display: grid;
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .app-nav {
        padding: 14px 18px;
        gap: 10px;
    }

    .brand img {
        width: 132px;
    }

    .nav-actions {
        justify-content: flex-end;
    }

    .nav-actions .btn.secondary {
        display: none;
    }

    .app-main {
        padding: 28px 18px 44px;
    }

    .page-title {
        font-size: 30px;
    }

    .page-lead {
        font-size: 16px;
    }

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

    .page-actions,
    .form-actions,
    .inline-actions,
    .upload-inline {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .page-actions .btn,
    .form-actions .btn,
    .form-actions button,
    .inline-actions .btn,
    .upload-inline button {
        width: 100%;
    }

    .receipt-meta div,
    .receipt-footer,
    .summary-list li {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .panel {
        padding: 20px;
    }

    .container {
        margin: 36px 18px;
    }
}
