@font-face { font-family: "Datatype"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("fonts/datatype-latin-wght-normal.woff2") format("woff2"); }
:root {
    --G50: #f6f6f6; --G100: #ececec; --G200: #dcdcdc; --G300: #c4c4c4; --G400: #a0a0a0;
    --G500: #7a7a7a; --G600: #5a5a5a; --G700: #3f3f3f; --G800: #2b2b2b; --G900: #1a1a1a;
    --Sky50: #f3f9ff; --Sky100: #e6f3fd; --Sky200: #d2e9fa; --Sky300: #b3dbf5; --Sky400: #8ec8ef; --Sky500: #5fb0e6; --SkyInk: #2b2b2b;
    --Logo: #8ec8ef; --LogoDark: #5fb0e6;
    --Green100: #e0f3dc; --Green200: #c8e8c1; --Green500: #4fae6e; --Green700: #1c7d45;
    --Red100: #fde4e1; --Red200: #f8c9c4; --Red500: #ea6c63; --Red700: #c4382f;
    --bs-body-font-family: "Datatype", Arial, sans-serif;
    --bs-link-color: #3f3f3f; --bs-link-hover-color: #1a1a1a; --bs-link-color-rgb: 63, 63, 63; --bs-link-hover-color-rgb: 26, 26, 26;
}
html { font-size: 16px; }
html, body { overflow-x: hidden; }
body { font-family: var(--bs-body-font-family); font-weight: 400; font-size: 1rem; color: var(--G800); background: linear-gradient(160deg, #f7fbff 0%, #d9eaf8 100%); background-attachment: fixed; min-height: 100vh; }
strong, .fw-semibold, .fw-bold, b { font-weight: 600 !important; }
h1, h2, h3, h4, h5, .navbar-brand { font-weight: 600; letter-spacing: .01em; color: var(--G900); }
a { text-underline-offset: .2em; }
.text-muted, .form-text { color: var(--G500) !important; }
.form-text { font-size: .85rem; }

/* icons */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; transition: transform .25s ease; }

/* navbar: taller than before, with a light blue line */
.navbar-custom { background: linear-gradient(90deg, var(--G900), var(--G700)); border-bottom: 4px solid var(--Sky400); min-height: 5.4rem; padding-top: 1rem; padding-bottom: 1rem; }
.navbar-brand { color: #f0f0f0 !important; font-size: 1.7rem; letter-spacing: .03em; margin-right: 2rem; }
.navbar-custom .nav-link { color: var(--G300); position: relative; font-size: 1.05rem; padding: .6rem 1rem; transition: color .2s ease; }
.navbar-custom .nav-link::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: .25rem; height: 2px; background: var(--Sky400); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.navbar-custom .nav-link:hover, .navbar-custom .nav-link.active { color: #fff; }
.navbar-custom .nav-link:hover::after, .navbar-custom .nav-link.active::after { transform: scaleX(1); }
.navbar-custom .btn-outline-light { color: var(--Sky200); border-color: var(--Sky400); font-size: .95rem; }
.navbar-custom .btn-outline-light:hover { background: var(--Sky400); color: var(--G900); }

/* cards */
.card-soft { background: #fff; border: 1px solid var(--Sky200); border-radius: 14px; box-shadow: 0 6px 18px rgba(60, 120, 170, .12); transition: transform .25s ease, box-shadow .25s ease; }
.row-gig { display: flex; justify-content: space-between; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--Sky100); transition: background .2s ease; }
.row-gig:last-child { border-bottom: 0; }

/* icon circles */
.icon-circle { width: 3rem; height: 3rem; flex: 0 0 3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--SkyInk); background: linear-gradient(145deg, var(--Sky200), var(--Sky400)); }
.page-title .icon-circle { background: #fff; color: var(--SkyInk); border: 2px solid var(--Sky300); }

/* buttons */
.btn { border-radius: 10px; font-weight: 400; font-size: 1rem; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }
.btn-sm { font-size: .9rem; }
.btn:active { transform: scale(.97); }
.btn-main { background: linear-gradient(145deg, var(--Sky300), var(--Sky500)); border: 1px solid var(--Sky500); color: var(--SkyInk); }
.btn-main:hover { color: var(--SkyInk); background: linear-gradient(145deg, var(--Sky200), var(--Sky400)); box-shadow: 0 6px 14px rgba(60, 130, 190, .3); }
.btn-sky { background: var(--Sky200); border: 1px solid var(--Sky400); color: var(--SkyInk); }
.btn-sky:hover { background: var(--Sky300); color: var(--SkyInk); }
.btn-outline-secondary, .btn-outline-danger, .btn-outline-dark { color: var(--G700); border-color: var(--Sky400); background: transparent; }
.btn-outline-secondary:hover, .btn-outline-danger:hover, .btn-outline-dark:hover { color: var(--SkyInk); background: var(--Sky200); border-color: var(--Sky500); }

/* forms */
.form-control, .form-select, .input-group-text { border-radius: 10px; border-color: var(--Sky300); background-color: #fff; color: var(--G800); font-size: 1rem; }
.form-label { font-weight: 500; margin-bottom: .25rem; }
.input-group-text { background: var(--Sky50); color: var(--SkyInk); }
.form-control:focus, .form-select:focus { border-color: var(--Sky500); box-shadow: 0 0 0 .22rem rgba(95, 176, 230, .3); }
.form-check-input:checked { background-color: var(--Sky500); border-color: var(--Sky500); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(95, 176, 230, .3); border-color: var(--Sky500); }

/* alerts and badges */
.alert-legacy { border-radius: 12px; background: var(--Sky100); border: 1px solid var(--Sky300); border-left: 5px solid var(--Sky500); color: var(--G800); animation: SlideIn .35s ease both; }
.alert-danger { border-color: var(--Red200); border-left-color: var(--Red500); background: var(--Red100); }
.alert-success { border-color: var(--Green200); border-left-color: var(--Green500); background: var(--Green100); }
.badge-pending { background: #fff; color: var(--SkyInk); border: 1px solid var(--Sky400); font-weight: 500; font-size: .85rem; }
.badge.text-bg-light { background: var(--Sky100) !important; color: var(--SkyInk) !important; border: 1px solid var(--Sky200); font-weight: 500; }

/* auth */
.auth-card { margin-top: 3rem; }
.auth-icon { width: 4.4rem; height: 4.4rem; font-size: 2.1rem; margin: -3.2rem auto 1rem auto; border: 4px solid #fff; }
.lang-switch a { color: var(--G600); text-decoration: none; margin: 0 .4rem; }
.lang-switch a.active { color: var(--SkyInk); text-decoration: underline; }
.text-break { overflow-wrap: anywhere; }

/* big site title (AppName), full width, top of home/login/register/forgot */
.app-title { display: block; width: 100%; text-align: center; text-decoration: none; color: var(--G900); line-height: 1.1; padding: calc(env(safe-area-inset-top, 0px) + 2.4rem) 1rem 0 1rem; }
.app-title:hover { color: var(--G700); }
.app-title-text { display: inline-block; font-size: clamp(1.9rem, 7vw, 3rem); letter-spacing: .02em; }

/* filter panel (closed by default) */
.filter-block { padding: .8rem 1rem; border-top: 1px solid var(--G200); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.filter-label { display: block; font-size: .85rem; color: var(--G600); margin-bottom: .2rem; }
.filter-block .form-check { margin-bottom: .35rem; }
.filter-block .form-check:last-child { margin-bottom: 0; }
.filter-dd { position: relative; }
.filter-dd-button { width: 100%; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-dd-menu { width: 100%; min-width: 12rem; max-height: 17rem; overflow-y: auto; overscroll-behavior: contain; padding: .4rem .2rem; }
.filter-dd-menu .dropdown-item { display: block; padding: .3rem .8rem .3rem 2.3rem; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.filter-dd-menu .form-check-input { margin-left: -1.5rem; }
.filter-dd-search { margin: 0 .5rem .4rem .5rem; width: calc(100% - 1rem); }

/* summary */
.summary-card { text-align: center; padding: 1.1rem 1rem 1.2rem 1rem; margin-bottom: 1rem; background: #fff; border: 1px solid var(--G200); border-top: 3px solid var(--Sky400); border-radius: 12px; }
.summary-title { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--G500); }
.summary-range { margin-top: .25rem; font-size: .9rem; color: var(--G500); }
.summary-net { margin-top: .5rem; font-size: 2.2rem; line-height: 1.1; letter-spacing: .01em; }
.results-limit { margin-top: 1rem; text-align: center; color: var(--G600); }
.amount-positive { color: var(--Green700); }
.amount-negative { color: var(--Red700); }

/* results: compact grey rows, only the amount is coloured */
.entry-list { display: flex; flex-direction: column; gap: .25rem; }
.entry-empty { text-align: center; color: var(--G500); padding: 2.5rem 1rem; }
@media (min-width: 768px) {
    }
main.container::after { content: ""; display: block; height: 5.5rem; }

/* big + button, bottom right */
.fab { position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 1030; width: 4.6rem; height: 4.6rem; border-radius: 50%; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; background: #a6daf7; color: var(--SkyInk); box-shadow: 0 8px 22px rgba(40, 110, 170, .4); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.fab:hover { background: #bfe5fa; transform: scale(1.07); box-shadow: 0 12px 28px rgba(40, 110, 170, .45); }
.fab:active { transform: scale(.95); }
.fab-plus { position: relative; display: block; width: 2.1rem; height: 2.1rem; }
.fab-plus::before, .fab-plus::after { content: ""; position: absolute; background: currentColor; border-radius: .2rem; }
.fab-plus::before { left: 0; right: 0; top: 50%; height: .32rem; margin-top: -.16rem; }
.fab-plus::after { top: 0; bottom: 0; left: 50%; width: .32rem; margin-left: -.16rem; }

/* overlay to add or edit an entry: always fits the screen, scrolling happens inside the form */
html.overlay-open, body.overlay-open { overflow: hidden; }
.entry-overlay { position: fixed; inset: 0; z-index: 1045; display: flex; align-items: center; justify-content: center; padding: .5rem; }
.entry-backdrop { position: absolute; inset: 0; background: rgba(15, 55, 90, .5); animation: FadeIn .2s ease both; }
.entry-panel { position: relative; width: 100%; max-width: 31rem; max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(10, 40, 70, .4); animation: PopIn .22s ease both; }
.entry-tabs { display: flex; flex: 0 0 auto; background: #fff; }
.entry-tab { flex: 1 1 0; border: 0; background: #fff; padding: .8rem .5rem; font-family: inherit; font-size: 1.3rem; color: var(--G500); cursor: pointer; transition: background .2s ease, color .2s ease; }
.entry-tab:disabled { cursor: default; }
.entry-close { flex: 0 0 3.4rem; border: 0; background: #fff; color: var(--G500); cursor: pointer; font-size: 1.3rem; }
.entry-close:hover { color: var(--G900); }
.type-income .tab-income, .type-expense .tab-expense { background: var(--Sky100); color: var(--G900); }
.entry-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1.2rem 1.2rem 1.4rem; }
.entry-form { background: var(--Sky50); }
.type-income .only-expense, .type-expense .only-income { display: none !important; }
.entry-form .form-control, .entry-form .form-select { border-color: rgba(0, 0, 0, .14); }
.entry-field { margin-bottom: 1rem; }
.entry-optional { color: var(--G500); font-size: .85rem; }
.is-missing, .form-control.is-missing, .form-select.is-missing { background-color: #fde8e6 !important; border-color: #f0a8a2 !important; }
.attach-field.is-missing .attach-buttons { padding: .4rem; border-radius: 10px; background: #fde8e6; }
.attach-remove { border: 0; background: transparent; color: var(--G600); cursor: pointer; padding: 0 .2rem; }
.entry-amount-row { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }
.entry-currency { flex: 0 0 2rem; font-size: 1.8rem; line-height: 1; }
.entry-currency { color: var(--G600); }
.entry-amount-input { font-size: 1.6rem; text-align: center; padding: .3rem .5rem; }
.new-party-box { margin-top: .5rem; }
.char-counter { text-align: right; margin-top: .15rem; }
.char-counter.is-full { color: var(--Red700) !important; }
.date-group .form-control { min-width: 0; }
.btn-date { position: relative; background: #fff; border: 1px solid rgba(0, 0, 0, .14); color: var(--SkyInk); padding-left: .9rem; padding-right: .9rem; }
.btn-date:hover { background: var(--Sky100); color: var(--SkyInk); }
.js-date-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.btn-attach { position: relative; background: #fff; border: 1px dashed var(--G400); color: var(--G700); cursor: pointer; }
.btn-attach:hover { background: var(--Sky100); border-color: var(--Sky500); color: var(--SkyInk); }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.attach-current { margin-top: .5rem; }
.entry-buttons { display: flex; gap: .6rem; margin-top: 1.3rem; }
.btn-save { flex: 1 1 auto; background: var(--G800); border: 1px solid var(--G800); color: #fff; font-size: 1.25rem; letter-spacing: .04em; padding: .45rem 1rem; }
.btn-save:hover { background: var(--G900); border-color: var(--G900); color: #fff; }
.btn-delete { flex: 0 0 auto; background: #fff; border: 1px solid rgba(0, 0, 0, .18); color: var(--Red700); font-size: 1.2rem; }
.btn-delete:hover { background: var(--Red700); border-color: var(--Red700); color: #fff; }

/* message and confirm overlays (Bootstrap modals): close only with the buttons, fit the screen, scroll inside */
.modal-dialog { max-width: min(30rem, calc(100vw - 1rem)); margin-left: auto; margin-right: auto; }
.modal-dialog-scrollable { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
.modal-body { overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; font-size: 1.05rem; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-content { border: 0; border-radius: 14px; overflow: hidden; }
.notice-header { display: flex; align-items: center; gap: .7rem; border-bottom: 0; color: #fff; }
.notice-icon { font-size: 1.6rem; line-height: 1; }
.notice-header .modal-title { margin: 0; color: inherit; }
.notice-success .notice-header { background: #198754; }
.notice-danger .notice-header { background: #dc3545; }
.notice-warning .notice-header { background: #ffc107; color: #000; }
.notice-info .notice-header { background: #0d6efd; }
.confirm-modal .notice-header { background: #ffc107; color: #000; }
.confirm-modal.confirm-danger .notice-header { background: #dc3545; color: #fff; }
.btn-notice-ok { min-width: 6rem; color: #fff; border: 0; }
.notice-success .btn-notice-ok { background: #198754; }
.notice-danger .btn-notice-ok { background: #dc3545; }
.notice-warning .btn-notice-ok { background: #ffc107; color: #000; }
.notice-info .btn-notice-ok { background: #0d6efd; }
.btn-confirm-cancel { background: #fff; border: 1px solid var(--G400); color: var(--G800); }
.btn-confirm-yes { min-width: 6rem; background: #ffc107; border: 0; color: #000; }
.confirm-danger .btn-confirm-yes { background: #dc3545; color: #fff; }

/* home page for visitors: one screen, no scrolling
   title on top, enter icon at the bottom (same distance from the edge), circle + sentence centred between the two */
html:has(body.landing) { overflow: hidden; height: 100%; }
body.landing { position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column; }
body.landing main.container { flex: 1 1 auto; min-height: 0; max-width: none; padding: 0 !important; display: flex; animation: none; }
body.landing main.container::after { display: none; }
.landing-stage { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.landing-middle { flex: 1 1 0; min-height: 0; container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: 0 1.5rem; }
.landing-logo { flex: 0 0 auto; width: min(64vw, 40cqh); height: min(64vw, 40cqh); border-radius: 50%; background: var(--Logo); box-shadow: 0 18px 50px rgba(95, 176, 230, .35); animation: PopIn .6s ease both; }
.landing-sentence { flex: 0 0 auto; max-width: 26rem; margin: 0; text-align: center; color: var(--G700); font-size: 1rem; line-height: 1.4; }
.landing-bottom { flex: 0 0 auto; text-align: center; padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 2.4rem) 0; }
.landing-enter { display: inline-flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 1px solid var(--G300); background: #fff; color: var(--G800); font-size: 1.4rem; text-decoration: none; transition: background .2s ease; }
.landing-enter:hover { background: var(--Sky100); color: var(--G900); }

/* motion: light and cheap (opacity and transform only) */
@keyframes FadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes FadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes PopIn { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes SlideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
main.container { animation: FadeIn .45s ease both; }
.stagger > * { animation: FadeUp .45s ease both; }
.stagger > *:nth-child(1) { animation-delay: .04s; } .stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .12s; } .stagger > *:nth-child(4) { animation-delay: .16s; }
.stagger > *:nth-child(5) { animation-delay: .20s; } .stagger > *:nth-child(6) { animation-delay: .24s; }
.stagger > *:nth-child(7) { animation-delay: .28s; } .stagger > *:nth-child(8) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 575.98px) {
    main.container { padding-left: .9rem; padding-right: .9rem; }
}

/* login / register tabs */
.auth-card { margin-top: 1rem; overflow: hidden; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--G200); }
.auth-tab { flex: 1 1 0; border: 0; background: transparent; padding: .9rem .5rem; font: inherit; font-size: 1.05rem; color: var(--G500); cursor: pointer; border-bottom: 3px solid transparent; }
.auth-tab.active { color: var(--G900); border-bottom-color: var(--Sky400); background: var(--Sky50); }
.lang-switch { margin-top: 1.2rem !important; }

/* language switch in the menu */
.nav-lang { display: inline-flex; align-items: center; gap: .5rem; margin: .4rem 1rem .4rem 0; color: #fff; }
.nav-lang-link { color: rgba(255, 255, 255, .6); text-decoration: none; font-size: .95rem; padding: .05rem .35rem; border-radius: 6px; }
.nav-lang-link:hover { color: #fff; }
.nav-lang-link.active { color: #fff; background: rgba(255, 255, 255, .18); }

/* quick filters: bank (open payments) and PDF (missing documents) */

/* summary: figure first, results range under it */
.summary-range { margin-top: .5rem; margin-bottom: 0; }
.summary-net { margin-top: .4rem; }

/* result rows: transparent with a very thin grey line between them */
.entry-list { gap: 0; }
.item-count { display: inline-block; margin-left: .4rem; padding: 0 .5rem; border-radius: 999px; background: var(--G100); color: var(--G600); font-size: .8rem; }

/* attachments: two simple icons and small tiles */
.attach-buttons { display: flex; gap: .8rem; }
.attach-tiles { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .7rem; }
.attach-tile { position: relative; width: 4.6rem; height: 4.6rem; border-radius: 10px; background: #fff; border: 1px solid var(--G200); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--Red700); font-size: 1.9rem; }
.attach-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-tile a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
.attach-tile .attach-remove { position: absolute; top: 2px; right: 2px; width: 1.4rem; height: 1.4rem; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--G800); display: flex; align-items: center; justify-content: center; font-size: .8rem; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* waiting overlay while saving */
.busy-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(60, 60, 60, .55); }
.busy-overlay[hidden] { display: none; }
.busy-spinner { width: 4rem; height: 4rem; border-radius: 50%; border: .4rem solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: BusySpin .9s linear infinite; }
@keyframes BusySpin { to { transform: rotate(360deg); } }

/* result rows: a tap anywhere on the row opens Edit; amount left, date right, name (with a small black icon when something is missing) below */
.entry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "amount date" "name name"; align-items: baseline; gap: .1rem .8rem; padding: .55rem .4rem .5rem .4rem; background: transparent; border-bottom: 1px solid var(--G200); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s ease; }
.entry-row:last-child { border-bottom: 0; }
.entry-row:hover, .entry-row:active { background: rgba(255, 255, 255, .55); }
.entry-row:focus-visible { outline: 2px solid var(--Sky500); outline-offset: -2px; }
.entry-amount { grid-area: amount; white-space: nowrap; font-size: 1.05rem; }
.entry-date { grid-area: date; justify-self: end; white-space: nowrap; font-size: .95rem; color: var(--G900); }
.entry-name { grid-area: name; display: flex; align-items: center; gap: .55rem; min-width: 0; font-size: 1rem; color: var(--G900); }
.entry-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.attach-type { display: inline-flex; align-items: center; justify-content: center; width: 4.4rem; height: 4.4rem; padding: 0; border: 1px dashed var(--G400); border-radius: 12px; background: #fff; color: var(--G800); font-size: 2.1rem; cursor: pointer; }
.attach-type:hover:not(:disabled) { background: var(--Sky100); border-color: var(--Sky500); }
.attach-type:disabled { opacity: .35; cursor: default; }
.attach-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* filter menu that slides in from the right */
.filter-open { position: relative; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--G200); border-radius: 50%; background: #fff; color: var(--G800); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; cursor: pointer; }
.filter-open:hover { background: var(--Sky100); }
.filter-open-dot { position: absolute; top: .2rem; right: .2rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--Sky500); border: 1px solid #fff; }
.filter-note { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .8rem; margin: -.8rem 0 1rem 0; font-size: .9rem; color: var(--G500); }
.filter-note a { color: var(--G800); }
.filter-panel.offcanvas-end { width: min(24rem, 92vw); background: var(--Sky50); z-index: 1045; }
.filter-panel .offcanvas-header { border-bottom: 1px solid var(--G200); background: #fff; }
.filter-panel .offcanvas-body { overscroll-behavior: contain; padding: 1rem; }
.filter-panel .filter-panel .filter-block { padding: .8rem 0; border-top: 1px solid var(--G200); }
.filter-panel .filter-actions { display: flex; position: sticky; bottom: -1rem; padding-bottom: 1rem; background: var(--Sky50); }
.filter-panel .filter-dd .dropdown-menu.show { position: static !important; transform: none !important; inset: auto !important; float: none; width: 100%; margin-top: .3rem; box-shadow: none; border: 1px solid var(--G200); }
.filter-count { display: inline-block; min-width: 1.5rem; padding: .05rem .45rem; margin-right: .15rem; border-radius: 999px; background: var(--G800); color: #fff; font-size: .85rem; line-height: 1.3; text-align: center; }
.filter-note { align-items: center; }
.filter-checks .form-check { margin-bottom: .6rem; }
.filter-checks .form-check-label { display: inline-flex; align-items: center; gap: .45rem; }
.filter-checks .icon { font-size: 1.25rem; }
.entry-flag { flex: 0 0 auto; display: inline-flex; font-size: 1.5rem; color: var(--G900); pointer-events: none; }
.attach-tile { color: var(--G700); }
.attach-tile .icon { font-size: 2rem; }
.filter-close { border: 0; background: transparent; padding: .2rem; font-size: 1.4rem; color: var(--G700); cursor: pointer; line-height: 1; }
.filter-close:hover { color: var(--G900); }
.filter-actions { display: flex; gap: .6rem; }
.filter-actions .btn-save { flex: 1 1 auto; }
.filter-actions .btn-confirm-cancel { flex: 0 0 auto; }
.filter-panel .offcanvas-header { justify-content: space-between; }
.filter-close { margin-left: auto; }
.filter-actions .btn { white-space: nowrap; }
.filter-actions .btn-confirm-cancel, .filter-actions .btn-save { flex: 1 1 0; }

/* separators in the entry form */
.entry-sep { margin: 1.1rem 0; border: 0; border-top: 1px solid var(--G300); opacity: 1; }

/* attachments: one row per file (document icon + open | delete), then a single circled plus */
.attach-rows { display: flex; flex-direction: column; gap: .15rem; }
.attach-row { display: flex; align-items: center; gap: .7rem; padding: .25rem .2rem; }
.attach-row-icon { display: inline-flex; font-size: 1.7rem; color: var(--G900); }
.attach-row-link { border: 0; background: transparent; padding: 0; font: inherit; font-size: 1rem; color: var(--G900); text-decoration: underline; cursor: pointer; }
.attach-row-link:hover { color: var(--G700); }
.attach-row-separator { color: var(--G400); }
.attach-merge { display: inline-flex; align-items: center; gap: .4rem; margin: .6rem 0 0 .2rem; padding: 0; border: 0; background: transparent; font: inherit; font-size: .95rem; color: var(--G800); text-decoration: underline; cursor: pointer; }
.attach-merge[hidden] { display: none; }

/* two round buttons, one above the other: + (income, darker blue) and - (expense, lighter blue) */
.fab-stack { position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 1030; display: flex; flex-direction: column; gap: .9rem; }
.fab-stack .fab { position: static; width: 3.9rem; height: 3.9rem; font-size: 1.9rem; display: inline-flex; align-items: center; justify-content: center; color: var(--G900); }
.fab-stack .fab-plus-button { background: #62b0e6; box-shadow: 0 8px 22px rgba(40, 110, 170, .4); }
.fab-stack .fab-plus-button:hover { background: #4fa3de; }
.fab-stack .fab-minus-button { background: #b9dff7; box-shadow: 0 8px 22px rgba(40, 110, 170, .3); }
.fab-stack .fab-minus-button:hover { background: #a6d4f1; }
main.container::after { height: 11rem; }

/* red accents for the filters */
.filter-count { background: #d9434f; color: #fff; }
.filter-open-dot { background: #d9434f; }

/* tax simulation */
.tax-sum { margin-top: 1.5rem; max-width: 26rem; }
.tax-line { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; font-size: 1.15rem; }
.tax-result { margin-top: .3rem; padding-top: .8rem; border-top: 2px solid var(--G800); font-size: 1.4rem; }

/* menu: voci su una sola riga; filtri: le due colonne non si allargano quando si apre un menu a tendina */
.navbar .nav-link { white-space: nowrap; }
.filter-panel .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.filter-panel .filter-dd-menu { min-width: 0; }

/* two plain buttons: PDF and IMAGE, each opens the normal file chooser */
.attach-picks { display: flex; gap: .7rem; margin-top: .5rem; }
.attach-pick { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex: 1 1 0; padding: .6rem .8rem; border: 1px solid var(--G300); border-radius: 12px; background: #fff; color: var(--G900); font: inherit; font-size: 1rem; cursor: pointer; }
.attach-pick .icon { font-size: 1.6rem; }
.attach-pick:hover:not(:disabled) { background: var(--Sky100); border-color: var(--Sky500); }
.attach-pick:disabled { opacity: .4; cursor: default; }

/* ===================================================================
   v2: colori di + e -, raggruppamento, ordinamento, filtri compatti, spinner, numeri di fattura
   =================================================================== */

/* + verde gentile, - rosso gentile: due colori morbidi che stanno bene sul celeste dello sfondo */
.fab-stack .fab-plus-button { background: #93d6ab; color: #14532d; box-shadow: 0 8px 22px rgba(30, 130, 80, .35); }
.fab-stack .fab-plus-button:hover { background: #7fcb9b; }
.fab-stack .fab-minus-button { background: #f4aaa4; color: #7a1f1a; box-shadow: 0 8px 22px rgba(190, 70, 60, .32); }
.fab-stack .fab-minus-button:hover { background: #ef958e; }
.fab-stack .fab[hidden] { display: none; }

/* RAGGRUPPA e conferma: in basso a sinistra, alla stessa altezza di + e - */
.fab-stack-left { right: auto; left: 1.25rem; }
.fab-stack .fab-group-button, .fab-stack .fab-group-confirm { right: auto; bottom: auto; box-sizing: border-box; }
.fab-stack .fab-group-button { position: relative; background: #fff; color: var(--G800); border: 1.5px solid var(--Sky400); box-shadow: 0 8px 22px rgba(40, 110, 170, .25); }
.fab-stack .fab-group-button:hover { background: var(--Sky100); }
.fab-stack .fab-group-button.is-on { background: var(--G800); color: #fff; border-color: var(--G800); }
.fab-stack .fab-group-confirm { position: relative; background: var(--G800); color: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.fab-stack .fab-group-confirm:hover:not(:disabled) { background: var(--G900); }
.fab-stack .fab-group-confirm:disabled { opacity: .4; cursor: default; transform: none; }
.fab-badge { position: absolute; top: -.25rem; right: -.25rem; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: #fff; color: var(--G900); border: 1.5px solid var(--G800); font-size: .8rem; font-weight: 600; line-height: 1.3rem; text-align: center; }
.fab-stack .fab .icon { width: 1.7rem; height: 1.7rem; }

/* righe in modalita raggruppamento: la casella compare a sinistra */
.entry-check { display: none; grid-area: check; align-self: center; padding-right: .2rem; }
.entry-check .form-check-input { width: 1.35rem; height: 1.35rem; margin: 0; cursor: pointer; }
.group-mode .entry-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "check amount date" "check name name"; column-gap: .8rem; }
.group-mode .entry-check { display: flex; }
.group-mode .entry-row.is-selected { background: var(--Sky100); }
.group-mode .entry-row.is-incompatible { opacity: .4; cursor: not-allowed; }
.group-mode .entry-row.is-incompatible .form-check-input { cursor: not-allowed; }
.group-banner { margin: 0 0 .8rem 0; padding: .6rem .9rem; border-radius: 12px; background: var(--Sky100); border: 1px solid var(--Sky300); color: var(--G800); font-size: .92rem; }
.group-banner[hidden] { display: none; }
.group-notice { margin: 0 0 1rem 0; padding: .6rem .9rem; border-radius: 12px; background: var(--Sky100); border: 1px solid var(--Sky300); font-size: .92rem; }
.group-notice[hidden] { display: none; }

/* i due pulsanti dell'ordinamento */
.sort-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .8rem 0; }
.sort-button { display: inline-block; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--G300); background: #fff; color: var(--G700); font-size: .9rem; text-decoration: none; white-space: nowrap; }
.sort-button:hover { background: var(--Sky100); border-color: var(--Sky400); color: var(--G900); }
.sort-button.active { background: var(--G800); border-color: var(--G800); color: #fff; }

/* filtri: Jahr, Monat, Veranstalter e Ausgabenkategorie ognuno su una riga, carattere piu piccolo, niente a capo */
.filter-panel.offcanvas-end { width: min(26rem, 94vw); }
.filter-panel .filter-rows { display: block; }
.filter-panel .filter-dd-button { font-size: .85rem; padding-top: .35rem; padding-bottom: .35rem; }
.filter-panel .filter-dd-menu .dropdown-item { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .5rem; }
.filter-panel .filter-dd-menu .form-check-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel .filter-dd .form-label, .filter-panel .filter-rows .form-label { font-size: .85rem; margin-bottom: .25rem; }

/* spinner di attesa mentre un PDF o una immagine viene caricato */
.attach-row.is-loading { color: var(--G600); font-size: .95rem; }
.attach-spinner { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: .2rem solid var(--G200); border-top-color: var(--G800); animation: BusySpin .8s linear infinite; }
.busy-overlay { flex-direction: column; gap: 1rem; }
.busy-text { color: #fff; font-size: 1rem; text-align: center; max-width: 85vw; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }

/* cestino di un Veranstalter / una Kategorie ancora in uso: si vede ma non si puo usare */
.btn.is-blocked { opacity: .4; }

/* campi di testo lunghi (fino a 5000 caratteri): si possono allargare in altezza */
#EntryForm textarea { resize: vertical; min-height: 4.5rem; max-height: 60vh; }

/* numero di fattura */
.invoice-number { font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 600; letter-spacing: .04em; color: var(--G900); font-variant-numeric: tabular-nums; }
.invoice-use { white-space: normal; }

/* freccia dentro il pulsante di ordinamento attivo (giu = piu recenti prima, su = meno recenti prima) */
.sort-button .icon { width: 1rem; height: 1rem; vertical-align: -.15em; }

/* Jahr + Monat nello stesso blocco, Veranstalter + Kategorie nello stesso blocco: solo un po' di spazio in mezzo, nessuna linea */
.filter-panel .filter-rows > div + div { margin-top: .75rem; }

/* Einnahme senza Zahlungseingang: nella lista si vede il Datum der Leistung, in grigio chiaro */
.entry-date.is-unpaid { color: #b9b9b9; }

/* Steuersimulation: Kategorien mit Summe und Prozentfeld, Ergebnisschuetzen */
.tax-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--G200); }
.tax-cat:last-child { border-bottom: 0; }
.tax-cat-name { overflow-wrap: anywhere; }
.tax-cat-sum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tax-cat-input { width: 6.4rem; }
@media (max-width: 575.98px) {
    .tax-cat { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "sum input"; row-gap: .35rem; }
    .tax-cat-name { grid-area: name; }
    .tax-cat-sum { grid-area: sum; }
    .tax-cat-input { grid-area: input; }
}
.tax-buttons { display: grid; gap: .75rem; }
.tax-block-title { margin-top: 1.5rem; margin-bottom: .5rem; font-weight: 600; }
.tax-subtotal { border-top: 1px dashed var(--G300); padding-top: .35rem; }
.tax-final { margin-top: 1.5rem; padding-top: .6rem; border-top: 2px solid var(--G300); }
.tax-notes { margin-top: 1.5rem; padding-left: 1.1rem; font-size: .85rem; color: var(--G600); }
.tax-notes li { margin-bottom: .45rem; }
.tax-note-warning { color: #b45309; font-weight: 600; }
.tax-line > span:first-child { min-width: 0; }
.tax-line > span:last-child { white-space: nowrap; margin-left: .75rem; text-align: right; }
#TaxResult .tax-line { font-size: .92rem; }
#TaxResult .tax-line.tax-result { font-size: 1.05rem; }
#TaxResult .tax-line > span:last-child { margin-left: .5rem; }
