*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, sans-serif; background: #f4f5f6; color: #202326; }
input, select, textarea { font-size: 16px; }
h1 { font-size: 1.5rem; margin: 0 0 .35rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
a { color: #c24a08; text-decoration: none; }
.muted { color: #6f767d; font-size: .9rem; margin: 0 0 1rem; }

.shell { min-height: 100dvh; height: 100dvh; padding-bottom: 0; overflow: hidden; }
.side { display: none; }
.main {
    padding: max(1.1rem, calc(env(safe-area-inset-top) + .85rem)) 1rem calc(5rem + env(safe-area-inset-bottom));
    max-width: none; margin: 0;
    overflow: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}
.tabs {
    position: fixed; left: 0; right: 0; bottom: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    background: #0d0d0d; border-top: 1px solid #2c3034;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}
.tabs a { color: #d9dde1; text-align: center; padding: .85rem .05rem; font-size: .58rem; }
.tabs a.active { color: #f5680c; font-weight: 600; }
.tabs-more > summary { list-style: none; cursor: pointer; color: #d9dde1; text-align: center; padding: .85rem .05rem; font-size: .58rem; }
.tabs-more > summary::-webkit-details-marker { display: none; }
.tabs-more[open] > summary { color: #f5680c; font-weight: 600; }
.tabs-more-panel {
    position: absolute; left: 0; right: 0; bottom: 100%; max-height: 70vh; overflow: auto;
    background: #0d0d0d; border-top: 1px solid #2c3034; padding: .4rem 0 .8rem;
}
.tabs-more-panel a { display: block; text-align: left; font-size: .9rem; padding: .65rem 1.1rem; }
.tabs-more-panel form { margin: .6rem 1.1rem 0; }
.section-tabs { display: flex; gap: .35rem; overflow-x: auto; margin: 0 0 1.1rem; padding-bottom: .15rem; border-bottom: 1px solid #e0e2e5; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs a { flex: 0 0 auto; padding: .55rem .9rem; color: #4b5157; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.section-tabs a.active { color: #f5680c; border-bottom-color: #f5680c; font-weight: 600; }
.section-tabs .menu-count { margin-left: .35rem; }
.side-group { color: #8a9096; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin: 1rem 1.1rem .25rem; }
.side-nav .side-group:first-child { margin-top: 0; }

.cards { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; max-width: 920px; }
.card { background: #fff; border: 1px solid #e0e2e5; border-radius: 8px; padding: 1rem; }
.card .label { display: block; color: #6f767d; font-size: .75rem; margin-bottom: .35rem; }
.card strong { font-size: 1.15rem; }
.card.warn { background: #f8d7da; border-color: #e7b4b8; }

.table-wrap { overflow: auto; background: #fff; border: 1px solid #e0e2e5; border-radius: 8px; -webkit-overflow-scrolling: touch; }
.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid th { text-align: left; background: #f5680c; color: #fff; padding: .55rem .65rem; font-weight: 600; }
.grid td { padding: .55rem .65rem; border-bottom: 1px solid #eee; }
.grid .num { text-align: right; }
.grid tr.overdue { background: #f8d7da; color: #841f1f; }

.list { display: flex; flex-direction: column; gap: .5rem; }
.row-link {
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 8px; padding: .9rem 1rem; color: inherit;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-head { margin: 0 0 .5rem; }
.back-link {
    display: inline-flex; align-items: center;
    min-height: 44px; padding: .45rem .85rem .45rem 0;
    font-weight: 600;
}
.emp-sticky {
    position: sticky; top: 0; z-index: 6;
    background: #f4f5f6; padding: .35rem 0 .55rem; margin: 0 0 .35rem;
}
.emp-rates {
    display: flex; flex-wrap: wrap; gap: .45rem 1rem;
    margin-top: .4rem;
}
.emp-rates label {
    display: flex; align-items: center; gap: .4rem;
    font-size: .85rem; color: #6f767d; height: auto;
}
.emp-rates input.rate-in, .emp-rates select {
    width: 88px; height: 36px;
    border: 1px solid #cdd1d5; border-radius: 8px;
    padding: 0 .5rem; background: #fff;
}
.emp-rates select { width: auto; min-width: 9.5rem; }
.job-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .6rem;
    margin: 0 0 1rem;
}
.form-card label.check { display: flex; align-items: center; gap: .5rem; height: auto; margin-top: .85rem; }
.bulk-people { display: flex; flex-wrap: wrap; gap: .15rem 1rem; }
.bulk-people label.check { margin-top: .35rem; }
.form-card label.check input { width: auto; height: auto; }
.logo-sm { height: 40px; }
.kv { background: #fff; border: 1px solid #e0e2e5; border-radius: 8px; padding: .4rem 0; }
.kv > div { display: flex; justify-content: space-between; padding: .55rem 1rem; border-bottom: 1px solid #f0f0f0; }
.kv dt { color: #6f767d; }
.kv dd { margin: 0; font-weight: 600; }
.kv .due { background: #fff2e8; }
.kv .invoice { background: #e7f6ed; }
.kv .invoice-sub { background: #f3faf6; }
.kv .rest { background: #e8eef8; }
.kv .gap { height: .55rem; padding: .2rem 1rem; background: transparent; border-bottom: 0; }
.kv dd.neg, .neg { color: #b42318; }
.item {
    background: #fff; border: 1px solid #e0e2e5; border-radius: 10px; padding: .75rem .9rem;
    position: relative;
}
.item.open { border-color: #f5680c; }
.item.picked { border-color: #f5680c; background: #fff7ef; }
.item-main.picked { background: #fff7ef; outline: 1px solid #f5680c; border-radius: 8px; padding: .35rem; }
.item.issued {
    background: #fde8e8;
    border-color: #d64545;
}
.item.settled { background: #eef1f3; }
.item.issued.settled,
.item.paid-all {
    background: #e7f6ed;
    border-color: #2f9e62;
}
.item.overdue { background: #f8d7da; border-color: #e7b4b8; }
.item.weekend { background: #f3f4f5; }
.inline-field {
    display: flex; justify-content: space-between; align-items: center; gap: .75rem;
    margin-top: .45rem;
}
.inline-field span { color: #6f767d; font-size: .85rem; }
.inline-field input {
    width: 88px; height: 40px; border: 1px solid #cdd1d5; border-radius: 8px;
    padding: 0 .5rem; text-align: right; background: #fff7e9;
}
.item-main { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; width: 100%; }
.item a.item-main { color: inherit; }
.item-main.as-btn { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.item.as-btn {
    display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .85rem; }
.page-actions .btn { margin: 0; }
.compact-form {
    display: flex; flex-wrap: wrap; gap: .45rem .85rem; align-items: end;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 8px;
    padding: .55rem .75rem; margin: 0 0 .85rem;
}
.compact-form label { margin: 0; font-size: .75rem; color: #6f767d; display: flex; flex-direction: column; gap: .15rem; }
.compact-form input, .compact-form select {
    height: 34px; width: auto; min-width: 96px; border: 1px solid #cdd1d5; border-radius: 6px; padding: 0 .45rem;
}
.item-sub { margin: .35rem 0 0; }
.item-actions { display: flex; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.item-detail { margin-top: .65rem; padding-top: .55rem; border-top: 1px solid #f0f0f0; }
.item-detail p { margin: 0 0 .35rem; }
.cost-row {
    margin-top: .7rem; padding-top: .65rem; border-top: 1px solid #f0f0f0;
}
.cost-row select, .cost-row input {
    width: 100%; height: 40px; border: 1px solid #cdd1d5; border-radius: 8px;
    padding: 0 .55rem; margin-top: .35rem; background: #fff;
}
.form-card {
    background: #fff; border: 1px solid #e0e2e5; border-radius: 10px; padding: 1rem;
    margin: .75rem 0 1.2rem; border-top: 3px solid #f5680c;
}
.form-card label { display: block; font-size: .8rem; color: #6f767d; margin: .55rem 0 .25rem; }
.form-card input, .form-card select { width: 100%; height: 42px; border: 1px solid #cdd1d5; border-radius: 8px; padding: 0 .65rem; }
.form-card input[type=checkbox] { width: 18px; height: 18px; min-width: 18px; min-height: 18px; padding: 0; margin: 0 .4rem 0 0; flex: none; accent-color: #f5680c; vertical-align: middle; }
.form-card textarea {
    width: 100%; min-height: 84px; border: 1px solid #cdd1d5; border-radius: 8px;
    padding: .55rem .65rem; font: inherit; resize: vertical;
}
.form-card .item-actions { margin-top: .9rem; }
.form-card .btn { flex: 1; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .55rem; margin: .8rem 0 1rem; }
.person-icon { display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 1px solid #e0e2e5; background: #fff; border-radius: 12px; padding: .65rem .35rem; font: inherit; color: #202326; cursor: pointer; }
.person-icon.selected { border-color: #e67628; box-shadow: 0 0 0 2px #e6762844; }
.person-icon .avatar { width: 46px; height: 46px; border-radius: 50%; background: #202326; color: #fff; display: grid; place-items: center; font-weight: 800; }
.person-icon span:last-child { font-size: .75rem; text-align: center; line-height: 1.2; }
.person-icon.expired { border-color: #c62828; background: #fdecea; }
.person-icon.expired .avatar { background: #c62828; }
.person-icon.soon { border-color: #e67628; background: #fff4e5; }
.person-icon.soon .avatar { background: #e67628; }
.person-icon span.doc-person-state { font-size: .78rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.person-icon.expired.selected { border-color: #c62828; box-shadow: 0 0 0 2px #c6282844; }
.person-icon.expired .doc-person-state { color: #8e1b1b; }
.person-icon.soon .doc-person-state { color: #8a3b00; }
.doc-banner { margin: 0 0 1rem; padding: .85rem 1rem; border-radius: 12px; background: #fff6f4; border: 2px solid #c62828; }
.doc-banner-title { margin: 0 0 .45rem; font-size: 1.2rem; font-weight: 800; color: #8e1b1b; }
.doc-alert { margin: .35rem 0; padding: .55rem .7rem; border-radius: 8px; display: flex; flex-wrap: wrap; gap: .25rem .65rem; align-items: baseline; font-size: 1.05rem; line-height: 1.35; }
.doc-alert strong { font-size: 1.15rem; }
.doc-alert .doc-alert-state { font-weight: 800; text-transform: uppercase; font-size: .95rem; }
.doc-alert.expired { background: #fdecea; color: #8e1b1b; border-left: 4px solid #c62828; }
.doc-alert.soon { background: #fff4e5; color: #8a3b00; border-left: 4px solid #e67628; }
.doc-banner a, .doc-alert a { color: inherit; font-weight: 800; }
.receipt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .45rem; margin-top: .8rem; }
.receipt-chip { text-align: left; border: 1px solid #e0e2e5; background: #fff; border-radius: 10px; padding: .4rem .55rem; font: inherit; color: #202326; cursor: pointer; }
.receipt-chip strong { display: block; font-size: .82rem; line-height: 1.25; }
.receipt-chip span { color: #6f767d; font-size: .72rem; }
.receipt-chip.on { border-color: #e67628; box-shadow: 0 0 0 2px #e6762844; }
.receipt-add-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin: .75rem 0 .35rem;
}
.receipt-add-row .receipt-add-field {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 0; min-width: 0; max-width: 100%; flex: 1 1 15rem;
    font-size: .8rem; color: #6f767d;
}
.receipt-add-row .receipt-add-field select,
.receipt-add-row .receipt-add-field input {
    flex: 1 1 9rem; width: auto; min-width: 0; max-width: 100%;
    height: 34px; margin: 0; padding: 0 .55rem;
    border: 1px solid #cdd1d5; border-radius: 8px; background: #fff;
}
.receipt-add-row label.receipt-add-shoot {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: auto; max-width: 100%; min-height: 34px; margin: 0;
    padding: .3rem .75rem; font-size: .82rem; line-height: 1.2; white-space: nowrap;
}
.user-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
    width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 10px;
    padding: .85rem 1rem; margin: .45rem 0;
}
.user-row strong { font-size: 1rem; }
.user-row span { color: #6f767d; font-size: .85rem; }
.user-sheet {
    position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 20, .45);
    display: flex; align-items: flex-end; justify-content: center; padding: .75rem;
}
.user-sheet .form-card { width: min(520px, 100%); max-height: min(92vh, 760px); overflow: auto; margin: 0; }
@media (min-width: 700px) { .user-sheet { align-items: center; } }
.sheet-toggle { margin: 1.4rem 0 2rem; }
.sheet-toggle summary { cursor: pointer; font-weight: 600; color: #c45a0a; padding: .4rem 0; }
.btn { min-height: 42px; margin: .5rem 0 1rem; }
.receipt-upload-panel{margin:.4rem 0 0;padding:.45rem .55rem .5rem;background:rgba(255,255,255,.88);border:1px solid rgba(32,35,38,.12);border-radius:10px}
.receipt-upload-panel h3{margin:0;font-size:.78rem;font-weight:700;color:#202326}
.receipt-upload-panel p{margin:.12rem 0 .35rem;font-size:.72rem;line-height:1.3;color:#4a5158}
.receipt-upload-row{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.receipt-upload-panel label.receipt-note{display:flex;align-items:center;gap:.35rem;margin:0;width:auto;flex:1 1 150px;font-size:.72rem;color:#6f767d}
.form-card .receipt-upload-panel label.receipt-note,
.receipt-upload-panel label.receipt-note{display:flex}
.receipt-upload-panel label.receipt-note input,
.form-card .receipt-upload-panel input:not([type=file]){height:30px;width:auto;flex:1;min-width:0;margin:0;padding:0 .5rem;border:1px solid #e0e2e5;border-radius:8px;background:#fff}
.receipt-upload-actions{display:flex;flex-wrap:wrap;gap:.35rem}
.receipt-upload-panel label.receipt-file,
.receipt-upload-panel button.receipt-file{position:relative;overflow:hidden;display:inline-flex;align-items:center;width:auto;margin:0;min-height:30px;padding:.2rem .6rem;background:#fff;color:#202326;border:1px solid #d7dbdf;border-radius:8px;font:inherit;font-size:.75rem;font-weight:650;cursor:pointer}
.receipt-upload-panel input[type=file],
.form-card .receipt-upload-panel input[type=file]{position:absolute !important;width:1px !important;height:1px !important;min-height:0 !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;border:0 !important;opacity:0 !important}
.receipt-preview{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin-top:.4rem}
.receipt-preview img{max-width:160px;max-height:120px;border-radius:8px;border:1px solid #e0e2e5}
.receipt-preview p{flex:1 1 140px;margin:0}
.receipt-upload-panel a{font-size:.75rem;color:#202326}

@media (max-width: 859px) {
    .cards { grid-template-columns: 1fr; }
    .sheet-wrap {
        max-height: none;
        margin-bottom: 5.5rem;
        padding-bottom: 3.5rem;
    }
    h1 { font-size: 1.35rem; }
    .sheet.compact tbody input {
        min-height: 22px; height: 22px; font-size: 12px; min-width: 48px; padding: 0 2px;
    }
    .sheet.compact td, .sheet.compact th { padding: 1px 2px; }
    .sheet.hours tbody input { min-height: 36px; height: 36px; font-size: 16px; }
    .worker-chip, .kw-chip { width: 100%; }
    .worker-chip select { flex: 1; min-width: 0; }
    .sheet-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .sheet.profit td { padding: 2px 4px; }
    .sheet.costs tbody input, .sheet.costs tbody select { min-height: 18px; height: 18px; }
    .overview-cards .job-card {
        width: 100% !important; height: auto !important; min-height: 52px;
    }
    .note-cards .note-card {
        width: 100% !important; height: auto !important; min-height: 240px;
    }
    .finance-list { gap: .28rem; }
    .finance-list .item { padding: .28rem .45rem .28rem 1.7rem; border-radius: 8px; }
    .sum-edit { height: 32px; width: 96px; }
    .finance-list .muted { margin: 0; font-size: .78rem; }
    .finance-list .item-sub { margin: .1rem 0 0; }
}

.btn, .btn-sm {
    background: #f5680c; color: #fff; border: 0; border-radius: 7px;
    padding: .55rem 1rem; font-weight: 600; cursor: pointer;
}
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }
.btn.secondary, .btn-sm.secondary { background: #2c3034; }

.login { max-width: 360px; margin: 12vh auto; padding: 1.5rem; background: #fff; border-radius: 10px; border-top: 3px solid #f5680c; }
.login-logo { display: block; height: 48px; margin: 0 auto .35rem; }
.app-version { margin: 0 1rem .7rem; font-size: 11px; line-height: 1.2; color: #8b939a; letter-spacing: .02em; }
.side-user { margin: -.35rem 1rem .75rem; font-size: 13px; line-height: 1.25; color: #d7dce0; font-weight: 600; }
.main-user { margin: 0 0 .6rem; color: #3d4348; }
.login .app-version { text-align: center; margin: 0 0 1rem; }
.main-version { margin: 0 0 .6rem; }
.owner-switch { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: 0 0 .8rem; padding: .55rem .7rem; border: 1px solid #f5680c; border-radius: 8px; background: #fff7f1; }
.owner-switch span { font-weight: 700; }
@media (min-width: 860px) { .main-version, .main-user { display: none; } }
.login label { display: block; font-size: .8rem; color: #6f767d; margin: .6rem 0 .25rem; }
.login input { width: 100%; height: 38px; padding: 0 .6rem; border: 1px solid #cdd1d5; border-radius: 6px; }
.login .btn { margin-top: 1rem; width: 100%; }
.err { color: #b71c1c; }

.side .logo-refresh { display: block; margin: 1.1rem 1rem .4rem; padding: 0; border: 0; background: transparent; cursor: pointer; }
.side .logo { height: 44px; margin: 0; }
.side-kicker { color: #ffa91a; font-size: .65rem; letter-spacing: .06em; margin: 0 1.1rem 1rem; font-weight: 600; }
.side-nav a { display: block; color: #d9dde1; padding: .7rem 1.1rem; border-radius: 6px; margin: 0 .6rem; }
.side-nav a.active { background: #303438; color: #fff; }

@media (min-width: 860px) {
    .shell { display: grid; grid-template-columns: 220px 1fr; padding-bottom: 0; min-height: 100vh; height: 100vh; }
    .side { display: block; background: #0d0d0d; overflow: auto; }
    .tabs { display: none; }
    .main { padding: 1.6rem 1.8rem; }
    .sheet .label, .sheet th.label { position: sticky; left: 0; z-index: 3; min-width: 148px; }
    .sheet th.label { z-index: 4; }
    .job-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 220px));
    }
    .overview-cards .bubble {
        width: 230px;
        min-height: 96px;
    }
    .overview-cards .bubble-title { font-size: 13px; }
    .overview-cards .bubble-amount { font-size: 18px; }
    .board { min-height: 280px; }
}

#blazor-error-ui { display: none; }

html.feba-resuming::after {
    content: "Obnovuji…";
    position: fixed; inset: 0; z-index: 20000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(13, 13, 13, .72);
    color: #fff; font-weight: 700; font-size: 1.1rem;
    pointer-events: none;
}

#components-reconnect-modal {
    display: none;
    position: fixed; inset: 0; z-index: 19000;
    background: rgba(13, 13, 13, .72);
    align-items: center; justify-content: center;
    padding: 1.5rem;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}
#components-reconnect-modal .feba-reconnect-box {
    background: #fff; color: #111; border-radius: 12px;
    padding: 1.2rem 1.4rem; max-width: 22rem; text-align: center;
}
#components-reconnect-modal p { margin: 0 0 1rem; font-weight: 600; }
#components-reconnect-modal .feba-reconnect-failed,
#components-reconnect-modal .feba-reconnect-rejected { display: none; }
#components-reconnect-modal.components-reconnect-failed .feba-reconnect-show,
#components-reconnect-modal.components-reconnect-rejected .feba-reconnect-show { display: none; }
#components-reconnect-modal.components-reconnect-failed .feba-reconnect-failed { display: block; }
#components-reconnect-modal.components-reconnect-rejected .feba-reconnect-rejected { display: block; }

dialog.feba-alert {
    border: 0; border-top: 4px solid #b71c1c; border-radius: 12px;
    padding: 1.2rem 1.4rem; width: min(26rem, calc(100vw - 2rem));
    background: #fff; color: #111; box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
dialog.feba-alert::backdrop { background: rgba(13, 13, 13, .6); }
dialog.feba-alert h2 { margin: 0 0 .6rem; font-size: 1.05rem; color: #b71c1c; }
dialog.feba-alert .feba-alert-text { margin: 0 0 1rem; white-space: pre-line; line-height: 1.45; }
dialog.feba-alert form { display: flex; justify-content: flex-end; margin: 0; }
dialog.feba-alert .btn { margin: 0; }
.feba-toast {
    position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 18000; margin: 0; max-width: calc(100vw - 2rem);
    background: #1b5e20; color: #fff; border: 0; border-radius: 10px; padding: .75rem 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-weight: 600; cursor: pointer; font: inherit; text-align: center;
}

.board-hint { color: #8a9096; font-size: 12px; margin: .25rem 0 .15rem; }
.board {
    position: relative;
    background: #fff;
    border: 1px solid #e0e2e5;
    border-radius: 8px;
    margin-top: 1rem;
    touch-action: pan-x pan-y;
    overflow: visible;
    user-select: none;
    min-height: min(70dvh, 520px);
}
.board .bubble-tools {
    position: absolute;
    right: 6px;
    top: 4px;
    z-index: 3;
    display: flex;
    gap: 4px;
}
.board .bubble-tools .btn-sm { min-height: 26px; padding: 0 7px; font-size: 11px; }
.bubble.dragging { z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bubble {
    position: absolute;
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 1px 6px rgba(0,0,0,.12);
    cursor: grab;
    touch-action: none;
}
.bubble.overdue { background: #f8d7da; }
.bubble-card {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
    padding-bottom: 2px;
}
.bubble-rule {
    width: 1.5px;
    background: #2a2a2a;
    opacity: .85;
    margin: 6px 0;
    flex: 0 0 auto;
}
.bubble-text { display: flex; flex-direction: column; justify-content: center; padding: 8px 10px; min-width: 0; }
.bubble.emp .bubble-text { padding: 4px 6px; }
.bubble-title {
    color: #5c5c5c;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bubble.emp .bubble-title { font-size: 10px; }
.bubble-amount { font-size: 14px; font-weight: 700; color: #2a2a2a; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble.emp .bubble-amount { font-size: 11px; margin-top: 1px; }
.bubble-amount.neg { color: #b42318; }
.bubble-accent {
    position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: #f5680c; pointer-events: none;
}
.bubble-grip {
    position: absolute; right: 4px; bottom: 4px; width: 12px; height: 12px;
    border-right: 1.5px solid #2a2a2a; border-bottom: 1.5px solid #2a2a2a;
    cursor: nwse-resize; touch-action: none; z-index: 2;
}
.bubble-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .35rem;
    background: #fff6ee;
    color: #c45a0a;
    font-weight: 600;
    font-size: .85rem;
    padding: .35rem .5rem;
    cursor: grab;
    user-select: none;
    touch-action: none;
    flex: 0 0 auto;
}
.bubble-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.bubble-tools button {
    border: 0; background: #fff; color: #c45a0a; font-size: 12px; font-weight: 700;
    padding: 4px 8px; border-radius: 4px; cursor: pointer;
}
.bubble-tools button.danger { color: #b42318; }
.bubble-bar input.title {
    flex: 1; min-width: 80px; border: 0; background: transparent; font: inherit; color: inherit; font-weight: 600;
}
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .75rem; }
.sheet-toolbar input, .sheet-toolbar select { height: 34px; border: 1px solid #cdd1d5; border-radius: 6px; padding: 0 .45rem; }
.sheet-toolbar .err { margin: 0; }
.sheet-wrap { overflow: auto; background: #fff; border: 1px solid #e0e2e5; border-radius: 8px; max-height: calc(100dvh - 220px); -webkit-overflow-scrolling: touch; margin: 0 0 .85rem; }
.sheet { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.sheet th, .sheet td { border: 1px solid #e0e3e6; padding: 2px 4px; white-space: nowrap; }
.sheet th { background: #f5680c; color: #fff; position: sticky; top: 0; z-index: 2; min-width: 88px; font-weight: 600; }
.sheet th a { color: #fff; }
.sheet .label, .sheet th.label { background: #fff; min-width: 88px; text-align: left; color: inherit; }
.sheet th.label { background: #f5680c; color: #fff; }
.sheet .weekend { background: #f0f2f4; color: #6c747d; }
.sheet .summary { background: #fff0e2; font-weight: 600; }
.sheet tr.week-stripe-0 td { background: #ffe8c8; }
.sheet tr.week-stripe-1 td { background: #d7e6f8; }
.sheet tr.week-stripe-2 td { background: #dceccc; }
.sheet tr.week-stripe-0 td.label { background: #ffd39a; }
.sheet tr.week-stripe-1 td.label { background: #b7d0f0; }
.sheet tr.week-stripe-2 td.label { background: #c5e0b6; }
.sheet tr.week-stripe-0 td input,
.sheet tr.week-stripe-0 td select { background: #ffe8c8; }
.sheet tr.week-stripe-1 td input,
.sheet tr.week-stripe-1 td select { background: #d7e6f8; }
.sheet tr.week-stripe-2 td input,
.sheet tr.week-stripe-2 td select { background: #dceccc; }
.sheet .section td { background: #0d0d0d; color: #fff; font-weight: 700; }
.sheet .due { background: #fff0e2; font-weight: 700; font-size: 13px; }
.sheet .num { text-align: right; min-width: 88px; }
.sheet input { width: 100%; min-width: 72px; border: 0; background: transparent; text-align: right; padding: 2px 4px; font: inherit; }
.sheet.compact { font-size: 11px; }
.sheet.compact th, .sheet.compact td { padding: 1px 3px; }
.sheet.compact input, .sheet.compact select {
    min-width: 56px; height: 28px; font-size: 11px; width: 100%;
    border: 0; background: transparent; padding: 1px 3px; font: inherit;
}
.sheet.compact select { text-align: left; min-width: 88px; }
.sheet.compact td:not(.num) input { text-align: left; min-width: 80px; }
.sheet.hours tbody input { height: 18px; min-height: 18px; font-size: 11px; }
.sheet.hours th, .sheet.hours td { padding: 0 3px; }
.sheet.hours th .head-tools select, .sheet.hours th .head-tools button { height: 20px; }
.sheet.profit { font-size: 11px; }
.sheet.profit th, .sheet.profit td { padding: 3px 5px; }
.sheet.costs { font-size: 10px; }
.sheet.costs th, .sheet.costs td { padding: 0 3px; }
.sheet.costs tbody input, .sheet.costs tbody select {
    height: 20px; min-height: 20px; font-size: 10px; padding: 0 2px;
}
.sheet th input, .sheet th select { color: #202326; background: #fff; min-width: 90px; text-align: left; }
.sheet th .head-tools { display: flex; gap: 2px; align-items: center; }
.sheet th .head-tools select { flex: 1; }
.sheet th .head-tools button { min-height: 0; margin: 0; padding: 0 6px; height: 26px; }
.job-card {
    display: flex; flex-direction: column; gap: .2rem;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 8px;
    padding: .65rem .8rem; color: inherit; border-top: 3px solid #f5680c;
    position: relative;
}
.job-cards .job-card { padding-right: 1.6rem; height: 100%; }
.job-cards .job-card > a {
    display: flex; flex-direction: column; gap: .2rem; color: inherit;
    flex: 1 1 auto; min-height: 0;
}
.job-cards .job-card .item-actions {
    margin-top: auto;
    padding-top: .45rem;
    align-self: stretch;
}
.job-cards .job-card .form-card { padding: .7rem; flex: 0 0 auto; }
.job-card-title { font-weight: 700; }
.job-hint-desktop { display: none; }
.emp-switch { display: flex; align-items: center; gap: .4rem; }
.emp-switch h1 { margin: 0; flex: 1; min-width: 0; }
.emp-switch .btn-sm { margin: 0; flex: 0 0 auto; min-width: 44px; min-height: 44px; }
.compact-form.rate-form input[inputmode="decimal"],
.compact-form.rate-form select {
    background: #fffaf4;
    border: 1px solid #e8c4a0;
    color: #202326;
    font-weight: 700;
}
.crew-cars { margin: 0 0 .8rem; }
.crew-cars label { display: grid; gap: .25rem; margin: 0 0 .45rem; }
.worker-chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1rem; }
.worker-chip {
    display: flex; align-items: center; gap: .45rem;
    background: #fff; border: 1px solid #e8c4a0; border-radius: 10px;
    padding: .4rem .55rem;
}
.worker-chip select, .worker-chip input {
    height: 34px; border: 1px solid #e0e2e5; border-radius: 6px;
    background: #fff; color: #202326; font-weight: 700; padding: 0 .45rem;
}
.worker-chip select { min-width: 140px; }
.worker-chip input { width: 72px; text-align: right; background: #fffaf4; border-color: #e8c4a0; }
.worker-chip label { margin: 0; font-size: .7rem; color: #6f767d; display: flex; align-items: center; gap: .3rem; }
.kw-done { margin: 0 0 .85rem; }
.kw-done summary { cursor: pointer; font-weight: 700; }
.kw-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .85rem; }
.kw-chip {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    min-width: 108px; background: #fff; border: 1px solid #e8c4a0; border-radius: 10px;
    padding: .55rem .7rem; cursor: pointer; color: #202326; text-align: left;
}
.kw-chip strong { font-size: .95rem; }
.kw-chip span { font-size: .72rem; color: #6f767d; }
.kw-chip em { font-style: normal; font-size: .78rem; font-weight: 700; color: #c45a0a; }
.kw-chip.active { background: #f5680c; color: #fff; }
.kw-chip.active span, .kw-chip.active em { color: #fff; }
.week-panel {
    background: #fff; border: 1px solid #e8c4a0; border-radius: 12px;
    padding: .85rem 1rem 1rem; margin: 0 0 1rem;
}
.week-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.week-panel h3 { margin: 0; font-size: 1.05rem; }
.week-panel h4 { margin: .85rem 0 .4rem; font-size: .9rem; }
.week-sum { margin: .45rem 0 .2rem; font-size: .85rem; color: #5c5c5c; }
.week-hours { max-height: none; }
.week-hours th .name-pill,
.week-hours th .name-pill,
.sheet.hours th .name-pill {
    display: inline-block;
    background: #fff;
    color: #202326;
    border: 1px solid #e8c4a0;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 700;
}
.week-cost {
    display: grid; grid-template-columns: 1fr auto; gap: .25rem .55rem;
    align-items: center; border: 1px solid #e8d3c0; border-radius: 8px;
    padding: .45rem .55rem; margin: 0 0 .4rem; background: #fffaf4;
}
.week-cost strong { font-size: .85rem; }
.week-cost .muted { grid-column: 1 / -1; margin: 0; }
.week-cost select, .week-cost input {
    height: 32px; border: 1px solid #e0e2e5; border-radius: 6px; padding: 0 .4rem; background: #fff;
}
.rate-cards { display: grid; gap: .28rem; margin: 0 0 .65rem; }
.rate-cards label {
    display: flex; justify-content: space-between; align-items: center; gap: .55rem;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 6px;
    padding: .22rem .5rem; font-size: .8rem;
}
.rate-cards input {
    width: 84px; height: 32px; font-size: 16px; text-align: right;
    border: 1px solid #cdd1d5; border-radius: 6px; padding: 0 .4rem; background: #fff7e9;
}
.form-card input.rate-in { height: 32px; }
.board input, .board textarea { user-select: text; cursor: text; }
.bubble.table { overflow: hidden; cursor: default; }
.bubble.table .bubble-table { position: relative; }
.bubble-table { flex: 1; overflow: auto; padding: .35rem .35rem 18px; min-height: 0; }
.bubble-table table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.bubble-table th, .bubble-table td { border: 1px solid #eee; padding: 0; }
.bubble-table input { width: 100%; border: 0; padding: .2rem .3rem; font: inherit; background: transparent; }
.bubble-table .sum { color: #f5680c; font-weight: 600; padding: .3rem; }

.overview-cards, .note-cards {
    display: flex; flex-wrap: wrap; gap: .65rem; align-items: start;
    margin: 0 0 1rem;
}
.overview-cards .bubble {
    position: relative;
    left: auto; top: auto;
    width: 168px;
    min-height: 76px;
    cursor: default;
}
.overview-cards .bubble-card.as-btn {
    border: 0; background: none; padding: 0;
    width: 100%; height: 100%;
    text-align: left; cursor: pointer;
    font: inherit; color: inherit;
    display: flex; flex: 1;
}
.overview-cards .job-card {
    position: relative;
    box-sizing: border-box;
    justify-content: center;
    overflow: hidden;
    padding-right: 1.6rem;
}
.overview-cards .job-card .item-main {
    width: 100%; height: 100%;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 0;
}
.overview-cards .job-card.emp { padding: .45rem .65rem; }
.card-move {
    position: absolute; top: 6px; right: 6px;
    border: 0; background: transparent; color: #b0b4b8;
    cursor: grab; font-size: 16px; line-height: 1; padding: 8px 6px;
    touch-action: none; user-select: none;
}
.item-move {
    left: 0; right: auto; top: 0; bottom: 0;
    width: 28px; height: auto; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.emp-list .item { padding-left: 2rem; border-radius: 14px; }
.emp-list .item-main { align-items: center; }
.emp-list .emp-pay { white-space: nowrap; font-weight: 800; text-align: right; }
[data-sort-handle] { touch-action: none; user-select: none; cursor: grab; }
[data-sort-handle]:active { cursor: grabbing; }
.sorting, .sort-origin { opacity: .4; }
.sort-over { outline: 2px solid #f5680c; box-shadow: none; }
.overview-cards .card-move { z-index: 6; }
.job-cards .card-move { z-index: 5; padding: 12px 10px; font-size: 18px; }
.sort-ghost {
    position: fixed; z-index: 9999; pointer-events: none; margin: 0;
    opacity: .95; box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.bubble-bar .card-move { position: static; color: #c45a0a; padding: 0 4px 0 0; }
.card-move:hover { color: #f5680c; }
.job-card.drag-over, .bubble.table.drag-over { outline: 2px solid #f5680c; }
.note-cards .bubble.table {
    position: relative; left: auto; top: auto;
    box-sizing: border-box;
}
/* Staff payroll statement = always light “paper” (same as PNG), readable in any page theme */
.pay-export {
    background: #fff; color: #202326; border: 1px solid #e0e2e5; border-radius: 10px;
    padding: 1.1rem 1.2rem 1.2rem; max-width: 520px;
    border-top: 3px solid #f5680c;
    color-scheme: light;
}
.pay-export-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 0 .85rem;
}
.pay-export-head img { height: 36px; }
.pay-export-head strong { display: block; font-size: 1.05rem; color: #202326; }
.pay-export .muted { color: #6f767d; }
.pay-export .kv { border: 0; padding: 0; background: transparent; }
.pay-export .kv > div { border-bottom-color: #f0f0f0; background: transparent; color: #202326; }
.pay-export .kv dt { color: #6f767d; }
.pay-export .kv dd { color: #202326; }
.pay-export .kv .due { background: #fff2e8; }
.pay-export .kv .due dt,
.pay-export .kv .due dd { color: #c45a0a; }
.pay-export .kv .rest { background: #e8eef8; }
.pay-export .kv dd.neg,
.pay-export .neg { color: #b42318; }
.pay-export .sheet { color: #202326; background: #fff; }
.pay-export .sheet th { background: #f5680c; color: #fff; }
.pay-export .sheet td { color: #202326; background: #fff; }
.pay-export ul.muted,
.pay-export ul.muted li { color: #6f767d; }

.finance-split { display: flex; flex-direction: column; gap: 1.25rem; }
.finance-col .page-actions { margin: 0 0 .55rem; }
.finance-col .page-actions .btn { margin: 0; }
.finance-list { gap: .35rem; }
.finance-list .item { padding: .4rem .55rem .4rem 1.8rem; }
.finance-kv { margin: 1.4rem 0 2.2rem; }
.row-del {
    flex: 0 0 auto; width: 32px; height: 32px; padding: 0;
    border: 0; background: transparent; color: #b42318;
    font-size: 22px; line-height: 1; cursor: pointer;
}
.sign-btn {
    flex: 0 0 auto; width: 32px; height: 32px; padding: 0;
    border: 1px solid #cdd1d5; background: #fff; color: #202326;
    border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer;
}
.sign-btn:hover { border-color: #f5680c; color: #f5680c; }
.cur-btn {
    flex: 0 0 auto; min-width: 36px; height: 32px; padding: 0 .35rem;
    border: 1px solid #cdd1d5; background: #fff; color: #202326;
    border-radius: 8px; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer;
}
.cur-btn:hover { border-color: #f5680c; color: #f5680c; }
.sum-edit.neg { color: #b42318; }
.invoice-list .item, .emp-list .item, .finance-list .item { padding-right: 1.8rem; }
.emp-list .item, .finance-list .item { padding-left: 2rem; }
.finance-notes { min-width: 0; }
.finance-notes .note-cards {
    display: flex; flex-direction: column; gap: .65rem;
    justify-content: flex-start;
}
.finance-notes .note-card {
    position: relative !important; left: auto !important; top: auto !important;
    width: 100%; max-width: none; height: auto; min-height: 240px;
}
@media (min-width: 860px) {
    .finance-split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 1.4rem;
        align-items: start;
    }
    .finance-col, .finance-notes { min-width: 0; }
    .finance-list, .finance-kv { max-width: none; }
}
.kv-row {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    width: 100%; padding: .55rem 1rem; border: 0; border-bottom: 1px solid #f0f0f0;
    background: #fff; cursor: pointer; font: inherit; color: inherit; text-align: left;
}
.finance-row { display: flex; align-items: center; gap: .65rem; width: 100%; }
.finance-row .as-btn {
    flex: 1; min-width: 0; border: 0; background: none; padding: 0;
    text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.sum-edit {
    width: 110px; height: 36px; flex: 0 0 auto;
    text-align: right; font-size: 16px; font-weight: 700;
    border: 1px solid #cdd1d5; border-radius: 8px;
    background: #fff7e9; padding: 0 .5rem; color: inherit;
}
.invoice-list { gap: .35rem; }
.invoice-list .item { padding: .4rem 1.7rem 1.45rem .6rem; border-radius: 8px; }
.invoice-list .inv-move {
    position: absolute; left: auto; right: 4px; top: auto; bottom: 4px;
    width: 32px; height: 28px; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.invoice-list .muted { margin: 0; font-size: .8rem; }
.invoice-list .item-sub { margin: .12rem 0 0; }
.invoice-list .item-actions { margin-top: .3rem; }
.kv-row dt .muted { display: block; font-weight: 400; margin: .15rem 0 0; }
.pay-month dt { font-weight: 600; }

.roster { display: flex; flex-direction: column; gap: 1rem; }
.roster-people h2 { margin: 0 0 .4rem; width: 100%; flex: 1 0 100%; }
.roster-people { display: flex; flex-wrap: wrap; gap: .35rem; align-content: flex-start; }
.roster-people .chip {
    border: 1px solid #e0e2e5; background: #fff; border-radius: 8px;
    padding: .4rem .55rem; font: inherit; cursor: pointer; color: inherit;
}
.roster-people .chip.on { outline: 2px solid #f5680c; background: #fff2e8; }
.roster-people .chip.used { opacity: .55; }
.roster-week {
    background: #fff; border: 1px solid #e0e2e5; border-radius: 10px;
    padding: .55rem .55rem .7rem; margin: 0 0 .75rem; overflow-x: auto;
}
.roster-week.open { border-color: #f5680c; box-shadow: 0 0 0 2px rgba(245,104,12,.18); }
.roster-week { cursor: pointer; }
.roster-week-selected { margin-left: auto; color: #f5680c; font-weight: 600; font-size: .85rem; }
.roster-people-all { width: 100%; flex: 1 0 100%; font-size: .85rem; }
.roster-period-edit { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.roster-week-head { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin: 0 0 .45rem; }
.roster-week-head strong {
    background: #f5680c; color: #fff; padding: .18rem .5rem; border-radius: 4px; font-size: .9rem;
}
.roster-week-head .muted { margin: 0; }
.roster-cars { display: flex; gap: .4rem; min-width: min-content; }
.roster-car {
    position: relative;
    min-width: 124px; max-width: 160px; flex: 1 0 124px;
    border: 1px solid rgba(0,0,0,.12); border-radius: 6px; padding: 1.35rem .35rem .35rem;
    cursor: pointer;
}
.roster-car .card-move { top: 2px; right: 22px; padding: 4px; font-size: 14px; color: #5a5e63; }
.roster-car .car-del { position: absolute; top: 0; right: 0; width: 26px; height: 26px; font-size: 18px; }
.roster-car.drop { outline: 2px dashed #f5680c; }
.roster-car .site {
    width: 100%; border: 0; background: transparent; font-weight: 700;
    font-size: .78rem; padding: 0 0 .2rem; min-width: 0;
}
.roster-car .car-name {
    width: 100%; border: 0; background: transparent;
    font-size: .72rem; font-weight: 700; margin: 0 0 .3rem;
    border-bottom: 1px solid rgba(0,0,0,.14); padding: 0 0 .2rem;
}
.roster-car .who {
    display: block; width: 100%; text-align: left; border: 0;
    background: rgba(255,255,255,.55); margin: 0 0 .22rem;
    padding: .18rem .28rem; border-radius: 4px; font: inherit; font-size: .82rem;
    cursor: pointer;
}
.roster-car .add {
    width: 100%; border: 1px dashed #8b9198; background: rgba(255,255,255,.4);
    border-radius: 4px; font-size: .78rem; padding: .15rem;
}
@media (min-width: 860px) {
    .roster {
        display: grid;
        grid-template-columns: 168px minmax(0, 1fr);
        gap: 1rem;
        align-items: start;
    }
    .roster-people {
        position: sticky; top: 0;
        max-height: calc(100vh - 7rem);
        overflow: auto;
        flex-direction: column;
        flex-wrap: nowrap;
    }
    .roster-people .chip { width: 100%; text-align: left; }
}
.note-card {
    width: 360px; height: 320px;
    display: flex; flex-direction: column;
}
.note-bar-top { cursor: default; }
.note-tools-lg button { min-height: 36px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.note-bar-bottom {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    padding: .4rem .5rem; border-top: 1px solid #f0f0f0; flex: 0 0 auto;
    background: #fffaf5;
}
.note-tools-sm button { min-height: 0; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.note-card .bubble-table { padding: .45rem .45rem .2rem; }
.note-card .bubble-table table { font-size: 13px; }
.note-card .bubble-table th input { font-weight: 600; font-size: 13px; }
.note-card .bubble-table td input { font-weight: 400; font-size: 13px; }
.note-card .sum { font-weight: 700; font-size: 14px; color: #c45a0a; margin: 0; padding: 0; }
#feba-png-preview {
    position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.72);
    display: flex; flex-direction: column; align-items: center; gap: .75rem;
    padding: max(1rem, env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
#feba-png-preview img {
    max-width: 100%; max-height: 68dvh; object-fit: contain;
    background: #fff; border-radius: 8px;
    -webkit-touch-callout: default;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
}
#feba-png-preview p { color: #fff; margin: 0; text-align: center; max-width: 22rem; }
#feba-png-preview button,
#feba-png-preview a.feba-png-save {
    background: #f5680c; color: #fff; border: 0; border-radius: 8px;
    padding: .6rem 1.2rem; font-weight: 700; min-height: 44px;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.pay-cols { display: grid; gap: 1rem; margin: .35rem 0 1rem; }
.pay-col {
    background: #fff;
    border: 1px solid #e0e2e5;
    border-radius: 12px;
    padding: .75rem .9rem 1rem;
    min-width: 0;
}
.pay-col h2 { margin-top: .15rem; }
@media (min-width: 860px) {
    .pay-cols { grid-template-columns: 1fr 1fr; align-items: start; }
}

.graf-bars {
    display: flex; gap: .35rem; align-items: flex-end;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background: #fff; border: 1px solid #e0e2e5; border-radius: 10px;
    padding: .85rem .7rem .65rem; min-height: 200px;
}
.graf-col {
    flex: 1 0 72px; min-width: 72px; max-width: 110px;
    display: flex; flex-direction: column; align-items: center; gap: .28rem;
}
.graf-bar-wrap {
    width: 100%; height: 140px;
    display: flex; align-items: flex-end; justify-content: center;
    background: #f4f5f6; border-radius: 6px 6px 0 0;
}
.graf-bar {
    width: 70%; min-height: 2px; border-radius: 5px 5px 0 0;
    background: #f5680c;
}
.graf-bar.neg { background: #d64545; }
.graf-col .graf-lab {
    font-size: .68rem; color: #6f767d; text-align: center; line-height: 1.15;
    text-transform: lowercase;
}
.graf-col strong { font-size: .68rem; text-align: center; font-weight: 700; }
a.btn-sm {
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; margin: 0;
}

.graf-legend {
    display: flex; flex-wrap: wrap; gap: .65rem 1.2rem;
    margin: 0 0 .55rem; font-size: .85rem; color: #6f767d;
}
.graf-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.graf-swatch {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    background: #f5680c;
}
.graf-swatch.start { background: #c5c9cd; }
.graf-pair {
    display: flex; gap: 3px; width: 100%; height: 140px; align-items: flex-end;
}
.graf-pair .graf-bar-wrap { flex: 1; height: 100%; }
.graf-bar.start { background: #c5c9cd; }
.amount-row { display: flex; align-items: center; gap: .4rem; }
.amount-row input { flex: 1; min-width: 0; }
.sheet .sum-edit { width: 100%; height: 32px; font-size: 14px; }

/* Navigation counts must remain styled across independently rendered components. */
.side-nav .menu-count, .tabs .menu-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; margin-left: .4rem;
    border-radius: 999px; background: #f5680c; color: #fff;
    font-size: .72rem; font-weight: 800; vertical-align: middle;
    line-height: 1; box-sizing: border-box; flex-shrink: 0;
}

/* Receipt categories and vehicles share a clear, touch-friendly card layout. */
.receipt-board { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.receipt-chip { border-radius: 16px; padding: .85rem; min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; background: var(--card, #fff); color: var(--text, #202326); }
.receipt-chip strong { font-size: .95rem; }
.receipt-chip span { color: inherit; font-size: .8rem; }
.receipt-chip.on { background: #fff0e3; color: #382310; border: 2px solid #b75208; box-shadow: 0 2px 8px #00000012; }
.receipt-chip:focus-visible { outline: 3px solid #b75208; outline-offset: 3px; }
.receipt-chip .receipt-kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.receipt-chip .receipt-plate { background: #fff; color: #202326; border: 1px solid #737373; border-radius: 5px; padding: .15rem .4rem; font-weight: 800; letter-spacing: .05em; }
.ride-other-receipts { margin-top: .75rem; border-radius: 12px; background: #fff; color: #202326; padding: .8rem; border: 2px solid #b75208; }
.ride-other-receipts > summary { cursor: pointer; font-weight: 800; font-size: 1rem; }

.receipt-preview-overlay { position: fixed; inset: 0; z-index: 2000; overflow: auto; background: #202326; color: #fff; padding: 1rem; text-align: center; }
.receipt-preview-overlay .travel-folder { width: min(640px, 100%); margin: 1.5rem auto; text-align: left; color: #202326; }
.travel-folder p { color: #3d444b; }
.travel-folder-current { margin: .75rem 0; padding: .7rem .8rem; border: 1px solid #e0e2e5; border-radius: 8px; background: #f7f8f9; overflow-wrap: anywhere; }
.travel-folder-current span { color: #6f767d; font-size: .8rem; }
.travel-folder-matches { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; margin: .75rem 0; max-height: 320px; overflow: auto; }
.travel-folder-create { display: flex; gap: .5rem; align-items: flex-end; }
.travel-folder-create label { flex: 1 1 auto; min-width: 0; }
.travel-folder-match { display: flex; width: 100%; text-align: left; justify-content: flex-start; }
.travel-folder .page-actions { justify-content: flex-start; }
.page-actions label.check { display: flex; align-items: center; margin: 0; height: auto; }
.page-actions label.check input { width: 18px; height: 18px; min-width: 18px; min-height: 18px; margin: 0; accent-color: #f5680c; }
.document-open { display: inline; width: auto; margin: 0; padding: 0; border: 0; background: none; color: #c24a08; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.receipt-preview-overlay img { display: block; max-width: 100%; max-height: 85vh; margin: 1rem auto; object-fit: contain; }
.receipt-preview-overlay iframe { display: block; width: 100%; height: 85vh; background: white; }

/* Shared action sizing: keep labels readable and controls easy to target. */
.btn, .btn-sm { box-sizing: border-box; min-height: 36px; line-height: 1.25; }
.btn { min-height: 42px; }
.page-actions, .item-actions { gap: .5rem; }
.item-main, .item-link, .job-card-title { min-width: 0; overflow-wrap: anywhere; }
.job-cards .job-card-title { padding-right: .6rem; }
.sheet-toolbar .btn-sm { min-width: 36px; }
@media (max-width: 700px), (pointer: coarse) {
    .btn, .btn-sm, .sheet-toolbar .btn-sm { min-height: 44px; }
    .page-actions > .btn, .item-actions > .btn-sm { white-space: normal; }
}

.roster-cars { align-items:flex-start; }
.receipt-history-row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.22rem 0; font-size:.85rem; }
.receipt-history-row>span { min-width:0; overflow-wrap:anywhere; }
.receipt-history-row .btn-sm { flex-shrink:0; margin:0; }
.receipt-fuel { border:2px solid #b75208; }
.receipt-fuel>h3 { color:#a94400; }
.ride-other-receipts { padding:.55rem; margin-top:.5rem; }
@media(min-width:701px) and (pointer:fine) {
    .receipt-history-row .btn-sm { min-height:30px; padding:.2rem .55rem; font-size:.75rem; }
}
.week-panel .week-sum { margin:.5rem 0 .75rem; }
.week-panel>a.btn { display:inline-flex; align-items:center; margin:0 0 .75rem; }

.receipt-upload-panel label.receipt-note { min-width:0; max-width:100%; }
.receipt-upload-panel label.receipt-note input { box-sizing:border-box; max-width:100%; }
.week-cost>label { min-width:0; margin:0; font-size:.8rem; }
.week-cost>label select { width:100%; }

input[type=checkbox] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 0 .4rem 0 0;
    flex: none;
    accent-color: #f5680c;
    vertical-align: middle;
}
.check { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.check input[type=checkbox] { margin: 0; }

.week-cost-fields { grid-column:1/-1; display:grid; grid-template-columns:minmax(100px,1fr) minmax(90px,.7fr) 90px minmax(160px,2fr); gap:.5rem; }
.week-cost-fields>label { display:flex; flex-direction:column; gap:.2rem; min-width:0; font-size:.75rem; color:#51575d; margin:0; }
.week-cost-fields input,.week-cost-fields select { width:100%; min-width:0; box-sizing:border-box; margin:0; }
@media(max-width:700px) {
    .week-cost-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .week-cost-fields .cost-description { grid-column:1/-1; }
}

/* Employee search shares the compact card styling across lists and bulk forms. */
label.employee-search { display: block; width: min(100%, 420px); margin: .65rem 0 .85rem; }
.employee-search-caption { display: block; margin: 0 0 .35rem .1rem; color: #626a72; font-size: .78rem; font-weight: 600; }
.employee-search-field { display: block; position: relative; }
.employee-search-field svg { position: absolute; left: 13px; top: 12px; width: 20px; height: 20px; color: #7b8289; pointer-events: none; }
label.employee-search input[type=search] { display: block; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0 14px 0 42px; border: 1px solid #dfe2e5; border-radius: 12px; background: #fff; color: #202326; font: inherit; font-size: 16px; box-shadow: 0 2px 5px #20232605; transition: border-color .15s, box-shadow .15s; }
label.employee-search input::placeholder { color: #858c93; }
label.employee-search input:hover { border-color: #c4c9ce; }
label.employee-search input:focus-visible { outline: 2px solid #f5680c; outline-offset: 2px; border-color: #f5680c; box-shadow: 0 0 0 4px #f5680c10; }
.employee-search-field:focus-within svg { color: #f5680c; }
@media (prefers-reduced-motion: reduce) { label.employee-search input { transition: none; } }
.company-table-hits { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 14rem; overflow: auto; margin: 0 0 .8rem; }

/* PDF green-card crop review, shared by uploads and existing documents. */
.feba-pdf-crop{position:fixed;inset:0;z-index:12000;background:#101417d9;display:flex;align-items:center;justify-content:center;padding:12px}.feba-pdf-crop section{background:#fff;color:#202326;border-radius:18px;width:min(100%,1050px);max-height:96dvh;display:flex;flex-direction:column;padding:16px;gap:10px;box-shadow:0 16px 60px #0007}.feba-pdf-crop h2,.feba-pdf-crop p{margin:0}.feba-pdf-crop .crop-stage{min-height:100px;overflow:auto;display:flex;justify-content:center;background:#e9ecef;border-radius:8px}.feba-pdf-crop canvas{max-width:100%;max-height:65dvh;object-fit:contain;width:auto;height:auto;touch-action:none;cursor:crosshair}.feba-pdf-crop img{max-width:100%;max-height:65dvh;object-fit:contain}.feba-pdf-crop [hidden]{display:none!important}.feba-pdf-crop button{border:1px solid #ccd1d4;border-radius:9px;background:#f3f4f5;color:#202326;min-height:40px;padding:8px 14px;font-weight:650;cursor:pointer}.feba-pdf-crop button:disabled{opacity:.45}.feba-pdf-crop [data-save],.feba-pdf-crop [data-review]{background:#ff7100;color:#fff;border-color:#ff7100}.feba-pdf-crop .crop-actions,.feba-pdf-crop .crop-pages{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.feba-pdf-crop .crop-actions{justify-content:flex-end}.feba-pdf-crop .crop-error{color:#b42318}.feba-pdf-crop button:focus-visible{outline:3px solid #ff7100;outline-offset:2px}

.travel-local { align-items: center; }
.supplier-cols { display: grid; gap: 1rem; margin: .35rem 0 1rem; }
.supplier-cols .item { margin: 0 0 .7rem; }
.supplier-cols img { max-width: 100%; height: auto; }
@media (min-width: 720px) {
    .supplier-cols { grid-template-columns: 1fr 1fr; align-items: start; }
}
details.supplier-mails { margin: 1.4rem 0 2rem; }
details.supplier-mails > summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; }
details.supplier-mails > .form-card { margin-top: .7rem; }
.platby-faktur .page-actions .btn { min-height: 48px; font-size: 1rem; }
.platby-faktur .item-actions { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
.platby-faktur .item-actions .btn,
.platby-faktur .form-card > .btn { width: 100%; flex: none; min-height: 48px; margin: 0; font-size: 1rem; padding: .55rem 1rem; }
.platby-faktur .item-actions.card-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; }
.platby-faktur .item-actions.card-actions .btn { width: auto; min-height: 36px; font-size: .875rem; padding: .35rem .7rem; white-space: nowrap; }
.platby-faktur details.supplier-add { margin: .8rem 0 1.2rem; }
.platby-faktur details.supplier-add > summary { list-style: none; display: flex; align-items: center; min-height: 48px; padding: .55rem 1rem; border-radius: 7px; background: #2c3034; color: #fff; font-weight: 700; font-size: 1rem; }
.platby-faktur details.supplier-add > summary::-webkit-details-marker { display: none; }
.supplier-pdf-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.supplier-pdf-dialog { background: #fff; color: #222; border-radius: 12px; width: min(960px, 100%); max-height: 92vh; overflow: auto; padding: 1rem; }
.supplier-pdf-dialog canvas { max-width: 100%; height: auto; }
details.travel-group { margin: .25rem 0; }
details.travel-group > summary { cursor: pointer; font-weight: 600; padding: .3rem 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
details.travel-month { margin-left: 1rem; }
details.travel-kw { margin-left: 1rem; border-left: 2px solid #f5680c33; padding-left: .6rem; }
