/* Rechnungsübersicht (rechnungen.html) — this page only. Colours and spacing come from the shared
   custom properties in coolhanx.css; the work bar, the "?" bubble and the tab bar are in ui.css.

   The idea of the page: an issued invoice has a story (written, sent, opened by the customer, paid)
   and the person looking at the list asks one question of it: what do I do next? So every row carries
   its payment state as a coloured edge (the word is always there too) and offers the ONE action the
   invoice is waiting for; the rest is behind "⋯". A click opens the story of that invoice in a panel
   beside the list — a timeline with filled dots for what happened and hollow ones for what has not —
   with its documents and the follow-up documents next to it. With no invoice selected the list has the
   whole width. */

.rn .page-head{margin-bottom:3px}
.rn-bar{flex-wrap:wrap;gap:8px 10px}
.rn-bar .btn{width:auto;white-space:nowrap}
.rn-bar .btn-primary{padding:8px 16px}

/* ---- the bar: states with their counts, search, filter ---- */
.rn-tabs{border-bottom:0;margin:0;overflow:visible;flex:0 1 auto}
.rn-tabs [role=tab]{padding:8px 10px;font-size:.86rem}
.rn-tabs [role=tab] .badge{margin-left:5px;padding:1px 7px}
.rn-tabs [role=tab][aria-selected=true] .badge{background:var(--accent-soft);color:var(--accent-strong);border-color:transparent}
.rn-tabs [role=tab].crit .badge{background:var(--crit-soft);color:var(--crit);border-color:color-mix(in srgb,var(--crit) 30%,transparent)}
.rn-tabs .rn-tab-drafts{margin-left:10px;border-left:1px solid var(--line-2);padding-left:16px}
.rn-tools{display:flex;align-items:center;gap:8px}
.rn-tools[hidden]{display:none}
.rn-search{width:170px;min-width:0;background:var(--surface-2);border:1px solid var(--line-2);border-radius:8px;padding:8px 11px;color:var(--ink);font:inherit;font-size:.86rem;box-sizing:border-box}
.rn-search:focus{border-color:var(--accent);background:var(--surface)}
.rn-reset{padding:7px 10px;font-size:.8rem;line-height:1.2}
.rn-filter{position:relative}
.rn-filter>summary{list-style:none;padding:8px 14px;cursor:pointer}
.rn-filter>summary::-webkit-details-marker{display:none}
.rn-filter[open]>summary{border-color:var(--accent)}
.rn-filter>summary .badge{margin-left:4px;padding:1px 7px}
.rn-filter:not([open])>.rn-fpop{display:none}
.rn-fpop{position:absolute;right:0;top:calc(100% + 6px);z-index:30;width:260px;padding:12px 14px 4px;box-shadow:var(--sh-2)}
.rn-fpop .fld{margin-bottom:10px}
.rn-fpop .fld label{display:block;font-size:.76rem;color:var(--muted);margin-bottom:3px}
.rn-fpop .fld input{width:100%;box-sizing:border-box}
@media(max-width:1400px){.rn-search{width:96px}.rn-filter>summary{padding:8px 10px}.rn-tools{gap:5px}.rn-tabs [role=tab]{padding:8px 7px;font-size:.82rem}.rn-tabs .rn-tab-drafts{margin-left:4px;padding-left:9px}}

/* ---- the figures: one line ---- */
.rn-strip{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 20px;margin:0 2px 10px}
.rn-fig{display:inline-flex;align-items:baseline;gap:7px;min-width:0}
.rn-fig .lab{font-size:.78rem;font-weight:650;color:var(--muted)}
.rn-fig b{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:1.05rem;font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.rn-fig .sub{font-size:.76rem;color:var(--muted)}
.rn-fig.crit b{color:var(--crit)}

/* ---- the list ---- (the panel has its place from the start: with nothing picked it says so) */
.rn .ph-actions{align-items:center}
.rn-grid{grid-template-columns:minmax(0,1fr) 370px}
@media(max-width:1400px){.rn-grid{grid-template-columns:minmax(0,1fr) 340px}}
@media(max-width:1100px){.rn-grid{grid-template-columns:minmax(0,1fr)}}
.rn-listcard{overflow:visible}
.rn-tbl{table-layout:fixed;width:100%}
.rn-tbl th,.rn-tbl td{padding-left:10px;padding-right:10px}
.rn-tbl th.bl-ck,.rn-tbl td.bl-ck{width:36px;padding-left:12px;padding-right:0}
.rn-tbl th:nth-child(3){width:116px}
.rn-tbl th:nth-child(4){width:92px}
.rn-tbl th:nth-child(5){width:138px}
.rn-tbl th:nth-child(6){width:112px}
.rn-tbl th:nth-child(7){width:56px}
/* next to the panel the row has no room for its own button: the one action is the first entry of the "⋯" menu
   (and the first button of the panel). On a wide screen it is on the row again, as it was. */
.rn-grid .rn-main{display:none}
@media(max-width:1400px){
  /* the document status is in the panel; the room goes to the number and the customer */
  .rn-tbl th:nth-child(4),.rn-tbl td:nth-child(4){display:none}
}
@media(min-width:1700px){
  .rn-grid{grid-template-columns:minmax(0,1fr) 400px}
  .rn-tbl th:nth-child(3){width:118px}.rn-tbl th:nth-child(4){width:112px}.rn-tbl th:nth-child(5){width:150px}
  .rn-tbl th:nth-child(6){width:128px}.rn-tbl th:nth-child(7){width:190px}
  .rn-grid .rn-main{display:inline-flex}
  .rn-mi.dup{display:none}
}
.rn-tbl td{vertical-align:middle;padding-top:7px;padding-bottom:7px;overflow:hidden}
.rn-tbl td.rn-actions{overflow:visible}
.rn-tbl td.empty{overflow:visible;white-space:normal}
.rn-tbl td:first-child{box-shadow:inset 3px 0 0 var(--rail,transparent)}
.rn-row.rn-overdue{--rail:var(--crit)}
.rn-row.rn-quar{--rail:var(--crit)}
.rn-row.rn-open{--rail:var(--accent)}
.rn-row.rn-paid{--rail:var(--good)}
.rn-row.sel{background:var(--accent-soft)}
.rn-row.rn-inrow .rn-num{cursor:pointer}
.rn-what{min-width:0}
.rn-num{display:block;max-width:100%;padding:0;background:none;border:0;color:var(--ink);font-family:var(--mono);font-size:.84rem;font-weight:700;text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rn-num:hover{color:var(--accent-strong);text-decoration:underline}
.rn-cust{display:block;margin-top:1px;font-size:.76rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rn-cust:empty{display:none}
.rn-tag{display:inline-block;margin-top:3px;margin-right:4px;font-size:.66rem;padding:0 6px}
.rn-note{font-size:.74rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rn-tbl td:nth-child(5) .rn-note,.rn-ref{white-space:normal;overflow:visible}
.rn-amt{text-align:right;white-space:nowrap}
.rn-tbl td:nth-child(3){white-space:nowrap}
.rn-tbl th:nth-child(6){text-align:right}
.rn-foot{padding:9px 14px;border-top:1px solid var(--line);font-size:.78rem;color:var(--muted)}
.rn-foot .num{font-weight:700;color:var(--ink)}
.rn-more td{text-align:center}

/* The first column is set the way Lexware sets a document: the partner in bold, under it "Rechnung – number" (and the
   marks: what kind, locked, bounced). The DOM keeps the number first (the button the keyboard walks); order puts it second. */
.rn-wh{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px}
.rn-wh .rn-cust{order:1;flex:1 0 100%;margin:0;font-size:.86rem;font-weight:700;color:var(--ink)}
.rn-wh .rn-kind{order:2;font-size:.76rem;color:var(--muted)}
.rn-wh .rn-kind::after{content:" –"}
.rn-wh .rn-num{order:3;display:inline-block;flex:0 1 auto;font-size:.78rem;font-weight:600;color:var(--muted)}
.rn-wh .rn-num:hover{color:var(--accent-strong)}
.rn-wh .rn-tag,.rn-wh .badge{order:4;margin:2px 0 0;flex:none}
.rn-wh .rn-cust.rn-ref{order:5;flex:1 0 100%;font-size:.74rem;font-weight:400;color:var(--muted)}
.rn-row.sel .rn-num{color:var(--accent-strong)}
.rn-amt{font-weight:700}
.rn-lock{cursor:help}

/* "Details" off: one slim line per document - the partner, then its number beside it, no second lines */
.bl-compact .rn-note,.bl-compact .rn-ref,.bl-compact .rn-kind{display:none}
.bl-compact .rn-tbl td{padding-top:3px;padding-bottom:3px}
@media(min-width:1401px){
  .bl-compact .rn-wh{flex-wrap:nowrap}
  .bl-compact .rn-wh .rn-cust{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bl-compact .rn-wh .rn-num{flex:none}
  .bl-compact .rn-wh .rn-tag,.bl-compact .rn-wh .badge{margin:0}
}

/* the panel: a locked invoice says so in words, and where else the invoice lives is one row of links */
.rn-lock-note{margin:10px 0 0;padding:8px 10px;border-left:3px solid var(--faint);border-radius:0 7px 7px 0;background:var(--surface-2);font-size:.78rem;line-height:1.45;color:var(--muted)}
.rn-links{display:flex;flex-wrap:wrap;align-items:center;gap:5px 6px;margin:12px 0 0}
.rn-links .lab{width:100%;font-size:.7rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.rn-lnk{width:auto;padding:4px 10px;font-size:.76rem}
.rn-empty p{margin:0 0 10px}
.rn-empty .btn{width:auto}

/* Ausgang | Eingang | Alle: what belongs to one direction is shown only there */
.rn[data-src=in] .rn-out,.rn[data-src=out] .rn-in{display:none}
.rn[data-src=out] .rn-allonly,.rn[data-src=in] .rn-allonly{display:none}
.rn[data-src=in] .rn-outonly,.rn[data-src=all] .rn-outonly{display:none}

/* one main action and a "more" menu */
.rn-actions{white-space:nowrap;text-align:right}
.rn-main{padding:5px 11px;font-size:.78rem;border-color:color-mix(in srgb,var(--accent) 45%,var(--line-2));color:var(--accent-strong)}
.rn-row.rn-overdue .rn-main{border-color:color-mix(in srgb,var(--crit) 50%,var(--line-2));color:var(--crit)}
.rn-menu-host{display:inline-block;position:relative;margin-left:6px;vertical-align:middle}
.rn-menu-host>summary{list-style:none;padding:4px 10px;font-size:.95rem;line-height:1.2;cursor:pointer}
.rn-menu-host>summary::-webkit-details-marker{display:none}
.rn-menu-host[open]>summary{border-color:var(--accent)}
.rn-menu-host:not([open])>.rn-menu{display:none}
.rn-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:20;min-width:170px;padding:5px;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line-2);border-radius:9px;box-shadow:var(--sh-2);text-align:left}
.rn-mi{padding:7px 10px;background:none;border:0;border-radius:6px;color:var(--ink);font:inherit;font-size:.82rem;text-align:left;cursor:pointer}
.rn-mi:hover,.rn-mi:focus-visible{background:var(--accent-soft);color:var(--accent-strong)}
.rn-mi:disabled{color:var(--faint);cursor:not-allowed;background:none}
.rn-mi.danger{color:var(--crit)}
.rn-mi.danger:hover,.rn-mi.danger:focus-visible{background:var(--crit-soft);color:var(--crit)}
.rn-menu-wide{min-width:250px}
.rn-mgroup{padding:6px 10px 3px;font-size:.66rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.rn-mgroup:not(:first-child){margin-top:4px;padding-top:8px;border-top:1px solid var(--line)}
.rn-menu .rn-hrow{margin:0}
.rn-menu .rn-hrow>.rn-mi{flex:1 1 auto}
.rn-menu .rn-hrow .qh{margin-right:6px}

/* ---- the panel beside the list ---- */
.rn-side{position:sticky;top:74px;min-width:0;max-height:calc(100vh - 100px);overflow-y:auto;overflow-x:hidden;padding:1px}
.rn-side[hidden]{display:none}
@media(max-width:1100px){.rn-side{position:static;max-height:none;overflow:visible}}
.rn-panel{padding:14px 16px 16px}
.rn-ph{display:flex;align-items:flex-start;gap:8px}
.rn-pt{flex:1;min-width:0}
.rn-title{margin:0;font-size:1.02rem;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rn-cust-link{display:block;max-width:100%;margin-top:2px;padding:0;background:none;border:0;color:var(--accent-strong);font:inherit;font-size:.84rem;text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rn-cust-link:hover{text-decoration:underline}
.rn-close{height:28px;min-width:28px;padding:0;font-size:1.05rem;line-height:1}
.rn-tags{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0}
.rn-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:8px;margin:12px 0 0;padding:10px 0 0;border-top:1px solid var(--line)}
.rn-fact .lab{display:block;font-size:.72rem;font-weight:700;color:var(--muted)}
.rn-fact b{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:.92rem;font-weight:800;white-space:nowrap}
.rn-fact.crit b{color:var(--crit)}
.rn-line{margin:6px 0 0;font-size:.8rem}
.rn-tb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:12px 0 0}
.rn-tb .btn{width:auto}
.rn-tb .rn-hrow{margin:0}
.rn-tbb{padding:6px 11px;font-size:.8rem}
.rn-tb .rn-menu-host{margin-left:0}
.rn-tb .rn-menu-host>summary{padding:6px 11px;font-size:.8rem;line-height:inherit}
.rn-sec{margin:14px 0 0;padding:12px 0 0;border-top:1px solid var(--line)}
.rn-h4{display:flex;align-items:center;margin:0 0 8px;font-size:.84rem;font-weight:800}
.rn-btns{display:flex;flex-wrap:wrap;gap:6px}
.rn-btns .btn{width:auto}
.rn-sm{padding:4px 10px;font-size:.78rem;width:auto}
.rn-hrow{display:flex;align-items:center;gap:2px;margin:0 0 6px}
.rn-hrow>.btn{flex:1 1 auto}
.rn-hrow .qh{flex:none;margin-left:6px}
.rn-linkout{display:flex;gap:6px;margin:0 0 8px}
.rn-linkout:empty{display:none}
.rn-linkin{flex:1;min-width:0;box-sizing:border-box;padding:5px 8px;font:inherit;font-size:.78rem;font-family:var(--mono);background:var(--surface-2);border:1px solid var(--line-2);border-radius:7px;color:var(--ink)}

/* the timeline: filled dot = it happened, hollow = it has not, orange/red = look at it */
.rn-tl{list-style:none;margin:0;padding:0 0 0 20px;position:relative}
.rn-tl::before{content:"";position:absolute;left:5px;top:6px;bottom:12px;width:2px;background:var(--line-2)}
.rn-tl li{position:relative;padding:0 0 10px;font-size:.84rem;line-height:1.35}
.rn-tl li:last-child{padding-bottom:0}
.rn-tl li::before{content:"";position:absolute;left:-20px;top:3px;width:12px;height:12px;border-radius:50%;box-sizing:border-box;background:var(--surface);border:2px solid var(--faint)}
.rn-tl li.done::before{background:var(--good);border-color:var(--good)}
.rn-tl li.warn::before{background:var(--warn-soft);border-color:var(--warn)}
.rn-tl li.crit::before{background:var(--crit);border-color:var(--crit)}
.rn-tl li.pending{color:var(--muted)}
.rn-tl-t{display:flex;justify-content:space-between;gap:10px;font-weight:650}
.rn-tl li.pending .rn-tl-t{font-weight:500}
.rn-tl .d{flex:none;font-family:var(--mono);font-size:.74rem;font-weight:500;color:var(--muted)}

/* ---- the drafts ---- */
.rn-dtbl td{vertical-align:middle}
.rn-dact{white-space:nowrap;text-align:right}
.rn-dact .btn{margin-left:6px}
@media(min-width:1700px){.rn-inrow .rn-menu-host{display:none}}
/* the toolbar's "Mehr" menu opens from the toolbar's left edge, inside the panel (the panel clips what sticks out) */
.rn-tb{position:relative}
.rn-tb .rn-menu-host{position:static}
.rn-tb .rn-menu{left:0;right:auto;top:calc(100% + 4px);max-width:100%;box-sizing:border-box}
.rn-tbl td:nth-child(3){font-size:.78rem}
