/* Read the News Finance – ruhiges Kassenbuch */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/instrument-sans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/instrument-sans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f7f4ee; --card: #ffffff; --ink: #17151c; --ink-2: #4a4652; --muted: #8a8590;
  --line: #ebe6dd; --line-2: #f2eee7; --soft: #f1ede6;
  --accent: #5b3fd6; --accent-ink: #ffffff; --accent-soft: #efebff;
  --in: #1f7a4d;
  --info: #3c56b5; --info-bg: #edf1fd; --success: #1f7a4d; --success-bg: #e8f4ec;
  --warning: #8a5a00; --warning-bg: #fbf1dc; --danger: #b3261e; --danger-bg: #fbe9e7;
  --soon: #5b3fd6; --soon-bg: #efebff; --test: #a0168f; --test-bg: #fae6f6;
  --r: 14px; --r-sm: 9px;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(23, 21, 28, .04);
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: #c9c3ba; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1 { font-size: 2rem; line-height: 1.15; margin: .2rem 0 .8rem; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.num, .sum-val, .entry-amount, .bk-fee, .detail-amount { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.num { text-align: right; }
.neg { color: var(--danger); }
.warn { color: var(--warning); font-weight: 600; }
.w100 { width: 100%; }
.mt { margin-top: 1rem; }
.inline { display: inline; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 1.6rem; padding: .7rem 1.6rem; background: rgba(247, 244, 238, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand img { display: block; }
.views { display: flex; gap: .2rem; background: var(--soft); padding: .25rem; border-radius: 999px; }
.views a { text-decoration: none; padding: .45rem 1.1rem; border-radius: 999px; color: var(--ink-2); font-weight: 550; }
.views a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 21, 28, .1); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.iconlink { text-decoration: none; color: var(--ink-2); padding: .3rem .45rem; border-radius: 8px; }
.iconlink.active, .iconlink:hover { background: var(--soft); color: var(--ink); }
.subnav { display: flex; gap: 1.4rem; padding: 0 1.6rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { text-decoration: none; padding: .7rem 0; color: var(--muted); white-space: nowrap; font-size: .93rem; border-bottom: 2px solid transparent; }
.subnav a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 550; }
.subnav .count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--warning-bg); color: var(--warning); font-size: .78rem; text-align: center; }
.container { max-width: 1280px; margin: 0 auto; padding: 1.8rem 1.6rem 4rem; }
.narrow { max-width: 680px; margin: 0 auto; }
.backlink { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: .6rem; font-size: .92rem; }
.backlink:hover { color: var(--ink); }

/* Kassenbuch */
.ledger-head { display: flex; align-items: center; gap: 1rem 1.2rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.ledger-head h1 { margin: 0 auto 0 0; font-size: 2.3rem; }
.secondary-actions { display: flex; gap: .4rem; flex-wrap: wrap; width: 100%; justify-content: flex-end; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1.4rem; }
.period select, .period input[type=date], .period input[type=search] { border-radius: 999px; padding: .45rem .9rem; background: var(--card); }
.period-label { color: var(--muted); font-size: .9rem; margin-left: .3rem; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: .22rem; gap: .1rem; }
.seg label { margin: 0; flex-direction: row; align-items: center; padding: .42rem .95rem; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: .92rem; white-space: nowrap; position: relative; }
.seg label.on, .seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 21, 28, .1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg-lg { display: flex; width: 100%; margin-bottom: .4rem; }
.seg-lg label { flex: 1; justify-content: center; padding: .7rem; font-size: 1rem; }
.sums { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .6rem; }
.sum { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.6rem 1.2rem; box-shadow: var(--shadow); }
.sum-label { font-size: .92rem; color: var(--muted); font-weight: 550; margin-bottom: .5rem; }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.sum-row + .sum-row { border-top: 1px solid var(--line-2); padding-top: .35rem; margin-top: .25rem; }
.sum-cur { color: var(--muted); font-weight: 550; font-size: .9rem; }
.sum-val { font-size: 2.3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.sum-in .sum-label::before { content: '↓ '; color: var(--in); }
.sum-out .sum-label::before { content: '↑ '; color: var(--ink-2); }
.sum-hint { font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.review-hint { margin: .4rem 0 1rem; font-size: .9rem; }
.review-hint a { color: var(--warning); text-decoration: none; }
.ledger-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; align-items: start; margin-top: 1rem; }
.ledger-wrap.has-panel { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); }
.ledger { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.day-head { padding: 1rem 1.3rem .45rem; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; border-top: 1px solid var(--line); background: #fcfbf8; }
.day:first-child .day-head { border-top: 0; }
.entry { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto minmax(150px, auto); gap: 1rem; align-items: center; padding: .9rem 1.3rem; text-decoration: none; border-top: 1px solid var(--line-2); transition: background .12s; }
.entry:hover { background: #faf8f4; }
.entry.is-active { background: var(--accent-soft); }
.entry.is-new { animation: flashnew 2.6s ease-out; }
@keyframes flashnew { 0%, 45% { background: var(--accent-soft); } 100% { background: transparent; } }
.entry-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); }
.dot-in { background: var(--in); }
.entry-main { display: flex; flex-direction: column; min-width: 0; }
.entry-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-sub { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { display: flex; align-items: center; gap: .45rem; justify-content: flex-end; flex-wrap: wrap; }
.entry-type { font-size: .78rem; color: var(--ink-2); background: var(--soft); padding: .12rem .5rem; border-radius: 6px; }
.doc { font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); border: 1px solid var(--line); padding: .05rem .35rem; border-radius: 5px; }
.doc-none { color: #c9c3ba; }
.entry-amount { text-align: right; font-size: 1.12rem; font-weight: 600; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.entry-amount small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.entry-amount .entry-open { color: var(--warning); }
.amt-in { color: var(--in); }
.is-pending .entry-amount { color: var(--muted); }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* Detail-Panel */
.panel { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 30px rgba(23, 21, 28, .07); max-height: calc(100vh - 96px); overflow: auto; }
.panel-inner { padding: 1.3rem; }
.panel-loading { padding: 2rem; color: var(--muted); }
.detail { position: relative; }
.detail-head { margin-bottom: 1rem; padding-right: 2.6rem; }
.panel-close { position: absolute; top: -.2rem; right: -.2rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1rem; color: var(--ink-2); }
.detail-kind { color: var(--muted); font-size: .86rem; }
.detail-title { font-size: 1.35rem; margin: .2rem 0 .3rem; overflow-wrap: anywhere; }
.detail-amount { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .4rem; }
.detail-amount small { font-size: .9rem; color: var(--muted); }
.detail-preview { background: var(--soft); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 1rem; }
.detail-preview iframe { width: 100%; height: 520px; border: 0; display: block; background: #e9e5de; }
.detail-preview img { width: 100%; display: block; max-height: 640px; object-fit: contain; background: #e9e5de; }
.nodoc { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.detail-rows { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0 0 1rem; font-size: .93rem; }
.detail-rows dt { color: var(--muted); }
.detail-rows dd { margin: 0; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Booker */
.bookings { display: flex; flex-direction: column; gap: .6rem; }
.bk { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 1.2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.3rem; text-decoration: none; box-shadow: var(--shadow); transition: border-color .12s; }
.bk:hover { border-color: #d6cfc4; }
.bk-date { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--soft); border-radius: 12px; height: 64px; }
.bk-day { font-size: 1.6rem; font-weight: 600; line-height: 1; }
.bk-mon { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .2rem; }
.bk-main { display: flex; flex-direction: column; min-width: 0; gap: .15rem; }
.bk-club { font-size: 1.15rem; font-weight: 600; }
.bk-event { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-status { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.bk-status .lbl { font-size: .76rem; color: var(--muted); }
.bk-status .lbl + .badge { margin-right: .5rem; }
.bk-side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; text-align: right; }
.bk-fee { font-size: 1.3rem; font-weight: 600; }
.bk-fee small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.bk-next { font-size: .9rem; color: var(--accent); font-weight: 550; }
.bk-flags { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.bk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.bk-head h1 { margin: .1rem 0 .2rem; }
.bk-head .bk-flags { justify-content: flex-start; }
.bigactions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.bigaction { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem; }
.ba-head { display: flex; align-items: center; gap: .6rem; }
.ba-title { font-size: 1.15rem; font-weight: 600; }
.ba-item { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; border-top: 1px solid var(--line-2); }
.ba-note { margin: 0; color: var(--ink-2); }
.list-card { padding: 0; overflow: hidden; }
.pick { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; text-decoration: none; border-top: 1px solid var(--line-2); }
.pick:first-child { border-top: 0; }
.pick:hover { background: #faf8f4; }

/* Karten & Layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card-danger { border-color: #f0cdc9; }
.card-warning { border-color: #eedcb3; }
.cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.cardhead h2 { margin: 0; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.actions, .buttonrow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.crumbs a { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid2.wide-left { grid-template-columns: 1.25fr 1fr; gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.tight { gap: 0 .8rem; }
.grid2 > .card, .grid3 > .card { margin-bottom: 1rem; }
.stack { display: flex; flex-direction: column; gap: .7rem; }

/* Tabellen */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: .65rem .55rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.tbl th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: #faf8f4; }
.tbl-compact th, .tbl-compact td { padding: .4rem .45rem; }
.tbl.sums th { text-transform: none; letter-spacing: 0; font-size: .93rem; color: var(--ink); font-weight: 500; }
.tbl tr.sep th, .tbl tr.sep td { border-top: 1px solid var(--line); }
.row-danger { box-shadow: inset 3px 0 0 var(--danger); }
.row-soon { box-shadow: inset 3px 0 0 var(--accent); }
.grouprow td { background: var(--soft); font-weight: 600; }
.subrow td { color: var(--muted); padding-top: .2rem; padding-bottom: .2rem; }
tr.deleted td { text-decoration: line-through; color: #aaa; }
.empty { color: var(--muted); text-align: center; padding: 1.6rem !important; }

/* Badges & Aufgaben */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .16rem .55rem; border-radius: 99px; background: var(--soft); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #efede9; color: #8a8590; }
.badge-soon { background: var(--soon-bg); color: var(--soon); }
.badge-test { background: var(--test-bg); color: var(--test); }
.tasks { display: flex; flex-wrap: wrap; gap: .35rem; }
.task { display: inline-flex; flex-direction: column; text-decoration: none; font-size: .84rem; font-weight: 600; padding: .35rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.task small { font-weight: 400; color: var(--muted); }
.task:hover { border-color: #cfc8bd; }
.task-danger { background: var(--danger-bg); border-color: #f0cdc9; color: var(--danger); }
.task-warning { background: var(--warning-bg); border-color: #eedcb3; color: var(--warning); }
.task-info { background: var(--info-bg); border-color: #d3dcf6; color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip { text-decoration: none; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); font-size: .88rem; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.big-flag { font-weight: 600; font-size: 1.05rem; }
.steps { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 1rem; }
.step { font-size: .8rem; padding: .28rem .7rem; border-radius: 99px; background: #efede9; color: var(--muted); }
.step.done { background: var(--success-bg); color: var(--success); }
.step.current { background: var(--accent); color: #fff; }

/* Formulare */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 550; margin-bottom: .8rem; color: var(--ink-2); }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; font-size: .97rem; padding: .62rem .75rem; border: 1px solid #ddd6cb; border-radius: 10px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); padding: 0; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem 1rem .2rem; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 .3rem; font-size: .92rem; }
.fielderr { color: var(--danger); font-size: .82rem; font-weight: 500; }
.has-error { border-color: var(--danger); }
.hint { color: var(--muted); }
.radios { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.inline-radios label { margin-bottom: 0; }
.inline-radios input:not([type=radio]) { width: 7rem; padding: .35rem .5rem; }
.radio-card { flex: 1 1 220px; flex-direction: row; align-items: flex-start; gap: .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem .9rem; cursor: pointer; background: #fff; }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.radio-card span { display: flex; flex-direction: column; gap: .1rem; }
.radio-card small { color: var(--muted); font-weight: 400; }
.contractchoice { background: #fcfbf8; }
.formactions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; }
.formactions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 0 .7rem; z-index: 5; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters label { margin: 0; flex-direction: row; align-items: center; gap: .35rem; }
.filters input, .filters select { padding: .45rem .6rem; font-size: .92rem; }
.inlineform { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: .4rem; }
.inlineform label { margin: 0; }
.sumline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .92rem; margin: .2rem 0 .9rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-size: .93rem; font-weight: 600; padding: .55rem 1rem; border-radius: 999px; border: 1px solid #ddd6cb; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 40px; }
.btn:hover { border-color: #b9b1a5; }
.btn-primary, .btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover, .btn-accent:hover { background: #4b30c2; border-color: #4b30c2; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-xl { font-size: 1.05rem; padding: .8rem 1.5rem; min-height: 52px; }
.btn-lg { font-size: 1rem; padding: .7rem 1.3rem; min-height: 48px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { font-size: .83rem; padding: .3rem .75rem; min-height: 32px; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn.danger { color: var(--danger); }

/* Meldungen */
.flash { padding: .75rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; border: 1px solid transparent; }
.flash ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.flash-success { background: var(--success-bg); color: #145c39; border-color: #cfe7d8; }
.flash-error { background: var(--danger-bg); color: #8a1c16; border-color: #f0cdc9; }
.flash-warning { background: var(--warning-bg); color: #6b4600; border-color: #eedcb3; }
.flash-info { background: var(--info-bg); color: #2a3f8a; border-color: #d3dcf6; }
.flashlink { font-weight: 600; margin-left: .4rem; }

/* Diverses */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 .8rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.plainlist { list-style: none; padding: 0; margin: 0 0 .6rem; }
.plainlist li { padding: .3rem 0; }
.filelist { list-style: none; padding: 0; margin: 0 0 .5rem; }
.filelist li { padding: .35rem 0; border-bottom: 1px solid var(--line-2); }
.history { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .86rem; }
.history li { padding: .3rem 0; border-bottom: 1px solid var(--line-2); word-break: break-word; }
details > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
details > summary h2 { display: inline; }
.danger-zone { border-color: #f0cdc9; }
.pdfcard { padding: .4rem; }
.pdfframe { width: 100%; height: 78vh; min-height: 520px; border: 0; border-radius: 10px; background: #e9e5de; }
.filepreview { margin-bottom: 1rem; }
.filepreview img { max-width: 100%; max-height: 520px; border: 1px solid var(--line); border-radius: 10px; display: block; }
.filepreview iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; }
.thumb img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.dropzone { border: 1.5px dashed #d2cabd; border-radius: var(--r-sm); padding: 1.3rem; text-align: center; background: #fcfbf8; cursor: pointer; }
.dropzone input { margin: .6rem auto 0; max-width: 100%; border: 0; background: transparent; }
.previewgrid { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.previewgrid img { height: 90px; border-radius: 8px; border: 1px solid var(--line); }
.previewgrid span { font-size: .85rem; padding: .3rem .5rem; background: var(--soft); border-radius: 6px; }
.items input { padding: .4rem .45rem; }
.items td.pos { color: var(--muted); width: 2rem; }
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem; width: min(440px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .18); }
dialog::backdrop { background: rgba(23, 21, 28, .35); }
dialog h3 { margin-top: 0; }

/* Anmeldung */
body.plain { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth-box { width: min(420px, 94vw); }
.auth-brand { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.2rem; font-size: 1.1rem; }

/* Tablet: Panel bildschirmfüllend */
@media (max-width: 1080px) {
  .ledger-wrap.has-panel { grid-template-columns: minmax(0, 1fr); }
  .panel { position: fixed; inset: 0; max-height: none; border-radius: 0; z-index: 50; border: 0; }
  .panel-inner { max-width: 760px; margin: 0 auto; padding: 1rem 1.1rem 2rem; }
  .grid2, .grid2.wide-left, .grid3 { grid-template-columns: 1fr; }
  .pdfframe { height: 60vh; }
  body.panel-open { overflow: hidden; }
}

/* Handy */
@media (max-width: 680px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .topbar { gap: .5rem; padding: .5rem .8rem; }
  .brand span { display: none; }
  .views { flex: 1; justify-content: center; }
  .views a { padding: .42rem .8rem; font-size: .93rem; }
  .usermenu { gap: .3rem; margin-left: 0; }
  .usermenu form, .hide-sm { display: none; }
  .subnav { padding: 0 .9rem; gap: 1.1rem; }
  .container { padding: .9rem .8rem 3rem; }
  h1 { font-size: 1.6rem; }
  .ledger-head { gap: .55rem; margin-bottom: .8rem; }
  .ledger-head h1 { font-size: 1.55rem; width: 100%; }
  .ledger-head .btn-xl { width: 100%; }
  .secondary-actions { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; }
  .secondary-actions .btn { font-size: .84rem; min-height: 36px; padding: .4rem .8rem; }
  .period { gap: .4rem; margin-bottom: .9rem; }
  .seg label { padding: .36rem .66rem; font-size: .85rem; }
  .period-label { width: 100%; margin: 0; font-size: .82rem; }
  .sums { gap: .5rem; }
  .sum { padding: .85rem .9rem .75rem; }
  .sum-val { font-size: 1.22rem; }
  .sum-hint { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main amount' 'meta meta'; gap: .2rem .7rem; padding: .75rem .95rem; }
  .entry-dot { display: none; }
  .entry-main { grid-area: main; }
  .entry-amount { grid-area: amount; font-size: 1.02rem; }
  .entry-meta { grid-area: meta; justify-content: flex-start; }
  .entry-title { white-space: normal; }
  .day-head { padding: .75rem .95rem .3rem; }
  .bk { grid-template-columns: 52px minmax(0, 1fr); gap: .8rem; padding: .85rem .95rem; }
  .bk-date { height: 52px; }
  .bk-day { font-size: 1.3rem; }
  .bk-side { grid-column: 1 / -1; align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: .4rem .8rem; }
  .bk-flags { justify-content: flex-start; }
  .bigactions { grid-template-columns: 1fr; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .tbl td { border: 0; padding: .15rem .2rem; text-align: left !important; }
  .tbl td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .tbl.items td::before { display: none; }
  .tbl-compact tr { display: flex; flex-wrap: wrap; gap: .2rem .6rem; }
  .tbl-compact td { width: auto; }
  .tbl.sums tr { display: flex; justify-content: space-between; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input, select, textarea { font-size: 16px; max-width: 100%; }
  .filters > * { flex: 1 1 45%; }
  .nowrap { white-space: normal; }
  .container, .card { overflow-wrap: anywhere; }
  .inlineform > * { flex: 1 1 auto; }
  .kv, .detail-rows { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd, .detail-rows dd { margin-bottom: .45rem; }
  .detail-preview iframe { height: 60vh; }
}

/* ---------- Kassenbuch: Zeilen mit Statusknopf (überschreibt obige Grundregeln) */
.entry { grid-template-columns: 10px minmax(0, 1fr) auto minmax(120px, auto) 132px; padding: .85rem 1.3rem; }
.entry-link { display: contents; color: inherit; text-decoration: none; cursor: pointer; }
.entry-pay { grid-column: 5; display: flex; justify-content: flex-end; }
.ledger-cols { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto minmax(120px, auto) 132px; gap: 1rem; padding: .7rem 1.3rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.ledger-cols span:nth-child(4) { text-align: right; grid-column: 4 / 6; }
.paybtn { display: inline-flex; align-items: center; justify-content: center; min-width: 108px; padding: .32rem .7rem; border-radius: 999px; font: inherit; font-size: .8rem; font-weight: 650; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.paybtn-red { background: var(--danger-bg); color: var(--danger); border-color: #f0cdc9; }
.paybtn-red::before { content: '● '; font-size: .7em; margin-right: .2rem; }
.paybtn-red:hover { background: #f8dcd8; }
.paybtn-green { background: var(--success-bg); color: var(--success); border-color: #cfe7d8; }
.paybtn-green::before { content: '✓ '; margin-right: .15rem; }
.paybtn-muted { background: #efede9; color: var(--muted); cursor: default; }
.seg .yr { color: var(--muted); font-weight: 500; margin-left: .25rem; font-variant-numeric: tabular-nums; }
.seg label.on .yr { color: var(--ink-2); }
.review-link { color: var(--warning); text-decoration: none; font-weight: 550; }
.ledger-head .btn-ghost { margin-left: 0; }
.addextra { border-top: 1px solid var(--line-2); padding-top: .8rem; margin-top: .4rem; }
.ocr-hint { font-size: .84rem; color: var(--accent); min-height: 1.2em; }
.suggested { background: #faf7ff; border-color: #cfc3ff; }
.uncertain { background: #fff8e6; border-color: #e9c46a; }
.addr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.addr-tabs { margin-bottom: .8rem; }
.addr-src { background: #fcfbf8; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem; }
.addr-src textarea { width: 100%; min-height: 9rem; font-size: .92rem; }
.addr-src img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.addr-fields label { margin-bottom: .55rem; }
.addr-status { font-size: .84rem; color: var(--muted); margin: .4rem 0; }
@media (max-width: 1080px) { .addr { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .ledger-cols { display: none; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main amount' 'meta pay'; gap: .25rem .6rem; padding: .75rem .95rem; }
  .entry-pay { grid-area: pay; grid-column: auto; }
  .entry-meta .doc, .entry-meta .entry-type { display: none; }
  .entry-meta:empty { display: none; }
  .paybtn { min-width: 0; padding: .3rem .65rem; }
  .ledger-head .btn-ghost { font-size: .84rem; min-height: 36px; padding: .35rem .8rem; }
}
.entry { scroll-margin-top: 45vh; }

/* Beleg hinzufügen: Belegdatum/Uhrzeit und Betrag/Währung paarweise, auch am Handy */
.pairgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.datepick { border: 1px solid #cfc3ff; background: var(--accent-soft); border-radius: 12px; padding: .7rem .9rem; margin: .4rem 0 .8rem; }
.datepick p { margin: 0 0 .4rem; }
.datepick .radios { display: flex; flex-wrap: wrap; gap: .4rem .6rem; }
.radio-inline { display: inline-flex; align-items: center; gap: .35rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; font-size: .9rem; cursor: pointer; margin: 0; }
.radio-inline { flex-direction: row; white-space: nowrap; }
.radio-inline input { display: inline-block; width: auto; margin: 0; flex: none; }
.radio-inline:has(input:checked) { border-color: var(--accent); background: #faf7ff; }
.entry-time { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ba-docs { display: inline-flex; gap: .35rem; margin-left: auto; }

/* Buchhaltung: Tabs Quittungen / Rechnungen unter den Summen, IN/OUT */
.doctabs { display: flex; align-items: flex-end; gap: .3rem; border-bottom: 1px solid var(--line); margin: 1.4rem 0 1rem; flex-wrap: wrap; }
.doctab { padding: .7rem 1.1rem; font-weight: 650; font-size: 1.02rem; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.doctab.on { color: var(--ink); border-bottom-color: var(--accent); }
.doctab .count { font-size: .72rem; font-weight: 700; background: #fde8e8; color: #b42318; border-radius: 999px; padding: .1rem .45rem; margin-left: .3rem; vertical-align: middle; }
.doctab-add { margin: 0 0 .5rem auto; }
.dirseg { display: inline-flex; margin: 0 0 1rem; }
.dirseg a { text-decoration: none; color: var(--ink-2); padding: .5rem 1rem; border-radius: 999px; }
.dirseg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dirseg .count { font-size: .72rem; font-weight: 700; background: #fde8e8; color: #b42318; border-radius: 999px; padding: .05rem .4rem; margin-left: .25rem; }
.dirpick { border: 0; padding: 0; margin: .4rem 0 .8rem; }
.dirpick legend { font-size: .88rem; font-weight: 550; color: var(--ink-2); margin-bottom: .3rem; }
.dirpick .seg label span { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.dirpick .seg label small { font-weight: 400; font-size: .76rem; color: var(--muted); }
.dirpick.ask .seg { outline: 2px solid #f59e0b; outline-offset: 2px; border-radius: 999px; }
.dir-ask { color: #b45309; font-weight: 600; }
@media (max-width: 640px) {
  .doctab-add { width: 100%; margin: .4rem 0 .6rem; order: 3; }
  .dirseg { display: flex; } .dirseg a { flex: 1; text-align: center; padding: .5rem .4rem; font-size: .86rem; }
}
.pairgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pairgrid > label, .pairgrid input, .pairgrid select { min-width: 0; max-width: 100%; }
.dirpick .seg { display: grid; grid-template-columns: 1fr 1fr; }
.dirpick .seg label { min-width: 0; white-space: normal; text-align: center; }
@media (max-width: 640px) {
  .dirpick .seg label b { font-size: .86rem; }
  .dirpick .seg label small { font-size: .7rem; }
  .dirseg a { line-height: 1.25; }
}

/* ===== Übersicht Buchhaltung: mehr Farbe, klare Hierarchie (Violett = Hauptaktion, Mint = Einnahmen, Korall = Ausgaben) ===== */
:root {
  --bg: #fbfaff; --line: #ece8f4; --line-2: #f3f0f8; --soft: #f3f0fa;
  --accent: #6a2ee8; --accent-ink: #fff; --accent-soft: #efe8ff; --accent-deep: #4f1fc4;
  --mint: #0f9d6b; --mint-bg: #e3f7ee; --mint-line: #bfead6;
  --coral: #e5553b; --coral-bg: #fff0eb; --coral-line: #ffd3c6;
}
.topbar { background: rgba(251, 250, 255, .94); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(106, 46, 232, .25); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-accent-soft { background: var(--accent-soft); border-color: #dccfff; color: var(--accent-deep); }
.btn-accent-soft:hover { background: #e4d9ff; }
.subnav a.active { color: var(--accent-deep); border-bottom-color: var(--accent); }
.ov-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin: .4rem 0 1.4rem; }
.ov-head h1 { margin: 0 auto 0 0; font-size: 2.4rem; letter-spacing: -.02em; }
.ov-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.sums { gap: 1.1rem; margin-bottom: 2rem; }
.sum { border-radius: 20px; padding: 1.5rem 1.7rem 1.3rem; box-shadow: none; }
.sum-in { background: var(--mint-bg); border-color: var(--mint-line); }
.sum-out { background: var(--coral-bg); border-color: var(--coral-line); }
.sum-in .sum-label, .sum-in .sum-label::before { color: var(--mint); }
.sum-out .sum-label, .sum-out .sum-label::before { color: var(--coral); }
.sum-label { font-size: 1.02rem; font-weight: 650; text-transform: none; }
.sum-val { font-size: 2.9rem; font-weight: 650; }
.sum-in .sum-row + .sum-row { border-top-color: var(--mint-line); }
.sum-out .sum-row + .sum-row { border-top-color: var(--coral-line); }
.ov-sub { font-size: 1.05rem; margin: 0 0 .8rem; font-weight: 650; }
.ov-sub span { font-weight: 400; color: var(--muted); font-size: .86rem; margin-left: .4rem; }
.doccards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.doccard { display: flex; flex-direction: column; gap: .2rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem 1rem; text-decoration: none; color: inherit; border-top: 4px solid var(--accent); transition: transform .12s, box-shadow .12s; min-width: 0; }
.doccard:hover, .doccard:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40, 20, 90, .08); }
.doccard-mint { border-top-color: var(--mint); }
.doccard-coral { border-top-color: var(--coral); }
.dc-label { font-weight: 650; font-size: 1rem; display: flex; justify-content: space-between; }
.dc-arrow { color: var(--accent); }
.doccard-mint .dc-arrow { color: var(--mint); }
.doccard-coral .dc-arrow { color: var(--coral); }
.dc-hint { font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }
.dc-row { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.dc-cur { font-size: .82rem; color: var(--muted); font-weight: 600; }
.dc-val { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dc-count { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.doc-total { color: var(--ink-2); font-size: .92rem; margin: -.6rem 0 1rem; }
.choice2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.choice { display: flex; flex-direction: column; gap: .4rem; padding: 1.4rem; border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.choice:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40, 20, 90, .08); }
.choice b { font-size: 1.15rem; }
.choice span:last-child { color: var(--ink-2); font-size: .9rem; }
.choice-tag { align-self: flex-start; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; }
.choice-out { border-top: 4px solid var(--mint); } .choice-out .choice-tag { background: var(--mint-bg); color: var(--mint); }
.choice-in { border-top: 4px solid var(--coral); } .choice-in .choice-tag { background: var(--coral-bg); color: var(--coral); }
.samebox, .dirwarn { border: 1px solid #f5c26b; background: #fff8e8; border-radius: 12px; padding: .8rem 1rem; margin: .6rem 0 1rem; }
.samebox p, .dirwarn p { margin: 0 0 .5rem; font-size: .9rem; }
.samebox .radios { flex-direction: column; gap: .35rem; margin: 0; }
.samebox label.check, .dirwarn label.check { font-size: .9rem; margin: 0; }
.cardline { font-size: .9rem; margin: -.2rem 0 .6rem; }
.contractdocs ul { margin: 0; padding-left: 1.1rem; }
@media (max-width: 760px) {
  .ov-head h1 { font-size: 2rem; }
  .ov-actions, .ov-actions .btn { width: 100%; }
  .sums { grid-template-columns: 1fr; }
  .sum-val { font-size: 2.3rem; }
  .doccards, .choice2 { grid-template-columns: 1fr; }
  .ledger-head .btn-xl { width: 100%; }
}

.entry.is-new { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }

/* ===================================================================================
   Dashboard-Layout (Referenz: dunkle Leiste · helle Seitenleiste · Arbeitsfläche)
   Ruhige graue Basis, feine Konturen, leicht erhöhte Karten. Violett = Hauptaktion,
   Mint = positive Akzente, Rot/Grün nur für den Zahlungsstatus.
   =================================================================================== */
:root {
  --bg: #e7e8eb; --surface: #f3f4f6; --work: #f8f8f9; --card: #ffffff;
  --line: #dcdee3; --line-2: #eceef1; --soft: #eceef1;
  --ink: #111215; --ink-2: #33363d; --muted: #646872;
  --accent: #6d28d9; --accent-deep: #5b21b6; --accent-soft: #f1ebfd;
  --mint: #0b8f63; --mint-bg: #eaf7f1; --mint-line: #c6eadb;
  --rail: #1b1c20;
  --raise: 0 1px 2px rgba(16, 17, 20, .05), 0 6px 20px rgba(16, 17, 20, .05);
}
body.shell { background: var(--bg); color: var(--ink); }
.app { display: grid; grid-template-columns: 64px 252px minmax(0, 1fr); gap: 12px; padding: 12px; min-height: 100vh; align-items: start; }

/* dunkle Leiste */
.rail { position: sticky; top: 12px; height: calc(100vh - 24px); background: var(--rail); border-radius: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.rail-logo { display: grid; place-items: center; width: 42px; height: 46px; background: #fff; border-radius: 12px; margin-bottom: 10px; }
.rail-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #a3a6ae; text-decoration: none; transition: background .12s, color .12s; }
.rail-btn:hover { background: #2a2c32; color: #fff; }
.rail-btn.on { background: #3a3c44; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 2px 6px rgba(0, 0, 0, .3); }
.rail-fill { flex: 1; }

/* helle Seitenleiste */
.side { position: sticky; top: 12px; height: calc(100vh - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px; display: flex; flex-direction: column; box-shadow: var(--raise); overflow-y: auto; }
.profile { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--rail); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: .82rem; letter-spacing: .02em; }
.profile-txt { min-width: 0; }
.profile-txt b, .mmenu-user b { display: block; font-size: .95rem; font-weight: 650; }
.profile-txt small, .mmenu-user small { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-label { font-size: .76rem; font-weight: 600; color: var(--muted); margin: 16px 10px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.snav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid transparent; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .95rem; }
.snav svg { color: var(--muted); flex: none; }
.snav:hover { background: #e9ebee; }
.snav.on { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(16, 17, 20, .06), 0 4px 12px rgba(16, 17, 20, .07); }
.snav.on svg { color: var(--accent); }
.side-logout { margin-top: auto; padding: 10px; }
.side-logout .linkbtn { color: var(--muted); }

/* Arbeitsfläche */
.work.container { background: var(--work); border: 1px solid var(--line); border-radius: 18px; max-width: none; margin: 0; padding: 28px 34px 56px; min-width: 0; min-height: calc(100vh - 24px); box-shadow: var(--raise); }
.mhead { display: none; }
h1 { letter-spacing: -.02em; }

/* Übersicht */
.ov-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title period" "actions actions"; gap: 14px 24px; align-items: end; margin: 0 0 24px; }
.ov-title { grid-area: title; min-width: 0; }
.ov-title h1 { margin: 0; font-size: 2.3rem; }
.ov-lead { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }
.ov-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 10px; }
.ov-period { grid-area: period; min-width: 0; }
.ov-period .period { margin: 0; justify-content: flex-end; }
.ov-period .period-label { display: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(109, 40, 217, .25); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-outline { background: #fff; border: 1.5px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: #f1f2f4; }
.seg { background: #e6e8ec; }
.seg label.on, .dirseg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 17, 20, .08), 0 2px 6px rgba(16, 17, 20, .06); }
.sums { gap: 14px; margin-bottom: 26px; }
.sum, .sum-in, .sum-out { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--raise); }
.sum-in { background: linear-gradient(180deg, var(--mint-bg) 0, #fff 70%); border-color: var(--mint-line); }
.sum-in .sum-label, .sum-in .sum-label::before { color: var(--mint); }
.sum-out .sum-label, .sum-out .sum-label::before { color: var(--ink-2); }
.sum-in .sum-row + .sum-row, .sum-out .sum-row + .sum-row { border-top-color: var(--line-2); }
.sum-val { font-size: 2.8rem; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-cur, .dc-cur, .sum-hint { color: var(--muted); }
.doccard, .doccard-mint, .doccard-coral { border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 16px; box-shadow: var(--raise); }
.doccard:hover, .doccard:focus-visible { border-color: #c5c8cf; box-shadow: 0 2px 4px rgba(16, 17, 20, .06), 0 12px 28px rgba(16, 17, 20, .08); }
.dc-arrow, .doccard-mint .dc-arrow, .doccard-coral .dc-arrow { color: var(--ink-2); }
.dc-val { color: var(--ink); }
.choice, .choice-out, .choice-in { border: 1px solid var(--line); border-top: 1px solid var(--line); box-shadow: var(--raise); }
.choice-out .choice-tag { background: var(--mint-bg); color: var(--mint); }
.choice-in .choice-tag { background: #eceef1; color: var(--ink-2); }
.ledger, .card { border-color: var(--line); box-shadow: var(--raise); }
.ledger-head h1 { font-size: 2.1rem; }
.subnav, .topbar { display: none; }
.entry.is-new { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }

/* Handy: eine kompakte Kopfzeile mit Menü */
@media (max-width: 900px) {
  .app { display: block; padding: 0; }
  .rail, .side { display: none; }
  .mhead { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; background: var(--rail); color: #fff; padding: 9px 12px; }
  .mhead-logo { flex: none; display: grid; place-items: center; width: 34px; height: 38px; background: #fff; border-radius: 10px; }
  .mhead-title { flex: 1; min-width: 0; font-size: .92rem; color: #c9cbd1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mhead-title b { color: #fff; font-weight: 600; }
  .mmenu summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 12px; border-radius: 10px; background: #2c2e34; color: #fff; font-weight: 600; font-size: .9rem; }
  .mmenu summary::-webkit-details-marker { display: none; }
  .mmenu[open] summary { background: #fff; color: var(--ink); }
  .mmenu-panel { position: absolute; right: 10px; top: 58px; width: min(310px, calc(100vw - 20px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .25); }
  .mmenu-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; min-width: 0; }
  .mmenu-user > span:last-child { min-width: 0; }
  .mmenu-foot { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
  .mmenu-foot form { padding: 6px 10px; }
  .work.container { border: 0; border-radius: 0; box-shadow: none; min-height: 0; padding: 18px 14px 44px; background: var(--work); }
  .ov-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "actions" "period"; gap: 12px; }
  .ov-title h1 { font-size: 1.9rem; }
  .ov-actions .btn { width: 100%; }
  .ov-period .period { justify-content: flex-start; }
  .sum-val { font-size: 2.2rem; }
}
@media (max-width: 360px) {
  .work.container { padding: 14px 10px 40px; }
  .sum { padding: 1.1rem 1.1rem 1rem; }
  .sum-val { font-size: 1.85rem; }
  .dc-val { font-size: 1.25rem; }
  .btn-xl { font-size: .98rem; padding: .75rem 1rem; }
  .seg label, .dirseg a { padding-left: .6rem; padding-right: .6rem; }
  .mhead-title { font-size: .85rem; }
}
.rail-btn.on { background: #fff; color: var(--rail); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
fieldset, .addrbox { min-width: 0; max-width: 100%; }
.addr-tabs { flex-wrap: wrap; max-width: 100%; }
.addr-tabs label { white-space: nowrap; }
@media (max-width: 1080px) { .addr { grid-template-columns: minmax(0, 1fr); } }
.addr-fields input, .addr-fields select, .addr-src textarea { min-width: 0; max-width: 100%; }
.grid2, .grid3 { min-width: 0; }
.grid2 > *, .grid3 > * { min-width: 0; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.day-head { background: #f3f4f6; color: var(--muted); }
.ledger-cols { background: #fff; }
