/* PeakJet admin (internal) — page-specific styles; tokens and base controls come from tokens.css. */
.app-head{border-bottom:1px solid var(--line-soft);background:#fff}
.app-head .wrap{display:flex;align-items:center;gap:14px;min-height:72px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}
/* One line: 'Agency Administration · internal' wrapped in English and broke the row (Dan, 20 Oct). */
.app-head .prod{font-size:13px;color:var(--text-2);padding-left:18px;border-left:1px solid var(--line-soft);white-space:nowrap}
.app-head .who{margin-left:auto;display:flex;align-items:center;gap:10px;font-size:13px}
.app-head .who .pill{height:40px;cursor:pointer;font-family:inherit}
.app-head.internal{background:var(--n900);border-bottom-color:var(--n800)}
.app-head.internal .prod{color:var(--p300);border-left-color:var(--n700)}
.app-head.internal .who{color:#fff}
.app-head.internal .pill{background:transparent;color:#fff;border-color:rgba(255,255,255,.35)}
.app-head.internal .pill:hover{background:rgba(255,255,255,.08)}
.app-head.internal .lang{border-color:rgba(255,255,255,.35)}
.app-head.internal .lang button{background:transparent;color:rgba(255,255,255,.8)}
.app-head.internal .lang button.on{background:#fff;color:var(--n900)}
.logo.inv svg{fill:#fff}
.avatar{width:28px;height:28px;border-radius:50%;background:var(--p500);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}

.page{padding-top:26px;padding-bottom:60px}
.pagehead{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px;flex-wrap:wrap}
.pagehead h2{font-size:26px;margin-bottom:4px}
.sub{color:var(--text-2);font-size:14px}
/* Says which agencies a page's edits reach — the one thing that was not obvious. */
.sub.scope{margin-top:6px;padding-left:10px;border-left:3px solid var(--p600);font-size:13px;max-width:70ch}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:.04em}
.back{display:inline-block;margin-bottom:14px;font-weight:500;color:var(--text-2)}
.card{margin-bottom:22px}
.pad{padding:22px}
.pad-h{padding:18px 20px 0}
h3{font-size:16px;margin-bottom:12px}
.filters{display:flex;gap:6px;flex-wrap:wrap}
.filters button{background:transparent;border:1px solid var(--line);border-radius:999px;padding:7px 14px;font-size:13px;font-weight:500;color:var(--text-2)}
.filters button.on{background:var(--n950);color:#fff;border-color:var(--n950)}

table{width:100%;border-collapse:collapse;font-size:14px}
th{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-2);text-align:left;padding:12px 20px;border-bottom:1px solid var(--line-soft);font-weight:600}
td{padding:13px 20px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr.row{cursor:pointer}
tbody tr.row:hover td{background:var(--n50)}
/* The agency list: fixed columns, so the row reads as a row. Left to itself
   the table gave the three sync chips a narrow column (three stacked lines,
   tall rows) and stranded the date against the right edge (Dan, 24 Sep 2026). */
/* Below ~1000px the fixed columns would collide ("REFERENZSTATUS"); the
   table keeps its shape and the card scrolls sideways instead. */
.table-scroll{overflow-x:auto}
#list-table{table-layout:fixed;min-width:1000px}
#list-table th,#list-table td{padding:12px 14px}
#list-table th:nth-child(1),#list-table td:nth-child(1){width:21%}
#list-table th:nth-child(2),#list-table td:nth-child(2){width:11%}
/* "Vertrag in Vorbereitung" is a long status: the chip wraps inside the cell
   rather than spilling into the next column. */
#list-table th:nth-child(3),#list-table td:nth-child(3){width:15%}
#list-table td:nth-child(3) .chip{white-space:normal}
#list-table th:nth-child(4),#list-table td:nth-child(4){width:12%}
#list-table th:nth-child(5),#list-table td:nth-child(5){width:5%;text-align:center}
/* Wide enough for the three chips side by side, which is the whole point. */
#list-table th:nth-child(6),#list-table td:nth-child(6){width:20%}
/* Wide enough for "24. Sept. 2026, 15:35" as one line — the column that made
   the row look broken when it wrapped. */
#list-table th:nth-child(7),#list-table td:nth-child(7){width:16%;white-space:nowrap}
#list-table td:nth-child(2){overflow-wrap:anywhere}
/* Short labels, state in the colour, the full wording in the tooltip: three
   chips that fit on one line instead of three. */
td .sync{display:flex;flex-wrap:wrap;gap:4px}
td .sync .chip{padding:2px 7px;font-size:11px}

.grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}
@media(max-width:860px){.grid{grid-template-columns:1fr}}
.grid .card{margin-bottom:0}
.grid{margin-bottom:22px}
dl{display:grid;grid-template-columns:minmax(150px,42%) 1fr;gap:8px 18px;font-size:14px;margin:0}
dt{color:var(--text-2);overflow-wrap:break-word;hyphens:auto}
dd{margin:0;overflow-wrap:break-word}
.foot{border-top:1px solid var(--line-soft);padding:18px 0 28px;font-size:12.5px;color:var(--text-2)}
.foot .wrap{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
.foot a{color:var(--text-2)}
.tier .fgroup{margin-bottom:14px}
.tier select{width:auto;min-width:180px}
.actions{display:flex;gap:12px}
.actions.between{justify-content:space-between;margin-top:20px}

.msg{border:1px solid var(--line-soft);border-radius:var(--r-sm);padding:14px 16px;margin-bottom:10px;font-size:14px}
.msg .meta{display:flex;gap:10px;flex-wrap:wrap;font-size:12.5px;color:var(--text-2);margin-bottom:8px;align-items:center}
.msg pre{white-space:pre-wrap;font-family:inherit;font-size:13.5px;margin:0;color:var(--text)}
.empty{color:var(--text-2);font-size:14px}
.tag{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;font-size:11px;font-weight:600;background:var(--p100);color:var(--p700);vertical-align:middle}
td .btn.sm{margin-right:6px}
tr.removed td{color:var(--n400)}
.actions.stack{flex-wrap:wrap}

.modal{position:fixed;inset:0;background:rgba(10,10,10,.55);display:flex;align-items:center;justify-content:center;padding:20px;z-index:50}
.modal-card{width:760px;max-width:100%;max-height:92vh;overflow:auto;padding:26px 28px;margin:0;box-shadow:var(--shadow-lg)}
.modal-card h3{font-size:20px}
.ro{height:48px;line-height:48px;padding:0 14px;border:1px solid var(--line-soft);border-radius:var(--r-sm);background:var(--n50);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fgroup{margin-bottom:16px}
/* A date input sizes to its content, so the hint beside it ran into the field
   instead of sitting under it (Dan, 23 Sep 2026). */
#sc-sections .fgroup input[type=date]{width:100%}
#sc-sections .fgroup > span.small{display:block;margin-top:4px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:600px){.grid2{grid-template-columns:1fr}}
.warn{background:var(--warn-bg,#FFF1CC);color:var(--warn-tx,#8C4F00);border-radius:var(--r-sm);padding:10px 14px}
.link-note{color:var(--text-2)}
.formerr{background:var(--danger-bg);color:var(--danger);border-radius:var(--r-sm);padding:12px 16px;font-size:14px;margin-bottom:12px}
textarea{line-height:1.5}

/* Contract master data (step 4a) */
.ct-tiers{width:100%;table-layout:auto}
.ct-tiers th{white-space:nowrap}
.ct-tiers td{vertical-align:top}
.ct-tiers input{width:100%;min-width:72px}
.ct-tiers td:last-child{min-width:260px}
/* The band is derived, so it is shown, not offered for editing. */
.ct-tiers td.ct-band{white-space:nowrap;color:var(--text-2);background:var(--n50);border-radius:var(--r-sm)}
.ct-stack{display:flex;flex-direction:column;gap:6px}
#ct-form h3{margin-top:22px}
#ct-form .actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}

/* Validation: the message belongs next to the field, not in a list of paths. */
.fielderr{display:block;margin-top:4px;font-size:12px;color:var(--danger)}
.ct-tiers .fielderr{white-space:normal}
.errlist{margin:6px 0 0;padding-left:20px}
.errlist li{margin:2px 0}
input.bad,textarea.bad,select.bad{border-color:var(--danger)}

/* Contract versions (step 4b) */
.ctr-versions{width:100%;margin-top:14px}
.ctr-versions th{white-space:nowrap}
#d-contract{margin-bottom:14px}

/* Schedule 1 form (step 4c) */
#sc-sections h3{margin:26px 0 4px}
#sc-sections .grid2{margin-top:10px}
#sc-sections textarea{width:100%;font:inherit;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm)}
#sc-sections input.ro{background:var(--n50);color:var(--text-2)}
.sc-contact{padding:12px 0;border-bottom:1px solid var(--line-soft)}
.sc-contact:last-of-type{border-bottom:0}
.sc-role{font-weight:600;margin:0 0 4px}
/* Ours on the left, the agency's two fields under each other on the right. */
.sc-stack{display:flex;flex-direction:column;gap:12px}
.sc-stack .fgroup{margin:0}
#sc-form .actions{display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-top:22px}
#sc-form .fgroup.inline{margin:0;min-width:200px}

/* Contract preview (step 4d) */
.modal-card.wide{max-width:900px;width:92vw}
#sc-preview-body{max-height:64vh;overflow:auto;border:1px solid var(--line-soft);border-radius:var(--r-sm);padding:18px 22px;background:#fff}
.sc-doc{font-size:13.5px;line-height:1.55}
.sc-doc h3{font-size:15px;margin:18px 0 6px}
.sc-doc p{margin:0 0 8px}
.sc-doc table{width:100%;border-collapse:collapse;margin:8px 0 14px}
.sc-doc th,.sc-doc td{border:1px solid var(--line);padding:6px 8px;text-align:left;vertical-align:top}
.sc-doc th{background:var(--n50)}
dl.sc-fixed{margin:10px 0 0}
dl.sc-fixed dt{color:var(--text-2)}
.m-attach{margin:4px 0 0;padding-left:20px;font-size:13px;color:var(--text-2)}
.m-attach li{margin:2px 0}
.sc-filed{margin-bottom:6px}
.sc-filed a{font-weight:500}
#sc-sections input[type=file]{font:inherit;font-size:13px}

/* PeakPass (subscriptions slice 1, step 2) */
/* The row already has a gap; the extra margin made the space before the nav twice the space after it. */
.prodnav{display:flex;gap:4px;flex-wrap:wrap}
.prodnav a{white-space:nowrap}
.prodnav a{padding:7px 13px;border-radius:999px;font-size:13px;font-weight:500;color:rgba(255,255,255,.75)}
.prodnav a:hover{background:rgba(255,255,255,.08);color:#fff}
.prodnav a.on{background:#fff;color:var(--n900)}
.kpi-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;margin-bottom:22px}
.kpi-tile{border:1px solid var(--line-soft);border-radius:var(--r-sm);padding:16px 18px;background:#fff}
.kpi-label{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-2);margin:0 0 6px}
.kpi-value{font-size:28px;font-weight:600;margin:0;line-height:1.1}
/* A balance may be negative by design (concept D-08) — it is a fact to show, not an error. */
.kpi-value.neg,td.neg{color:var(--danger);font-weight:600}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line-soft);margin-bottom:22px;flex-wrap:wrap}
.tabs button{background:transparent;border:0;border-bottom:2px solid transparent;padding:10px 14px;font:inherit;font-size:14px;font-weight:500;color:var(--text-2);cursor:pointer}
.tabs button.on{color:var(--text);border-bottom-color:var(--p600)}
/* The one place a clear code is ever shown. Monospace and roomy, because these
   get read off the screen and typed into Virto. */
.codelist{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:16px;letter-spacing:.08em;line-height:2;background:var(--n50);border:1px solid var(--line-soft);border-radius:var(--r-sm);padding:16px 18px;user-select:all}
.hint{font-size:13px;color:var(--text-2);margin-top:10px}

/* Row editors inside the PeakPass forms — route pairs and discount tiers. The
   labels only earn their place on the first row, so the rest are hidden and the
   column reads as a column (Dan, 20 Oct 2026: "present them properly"). */
.bk-rows{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.bk-row{display:flex;gap:12px;align-items:flex-start}
.bk-row .fgroup{margin-bottom:0;flex:1 1 0}
.bk-row input{width:100%}
.bk-row > .btn{margin-top:26px}
.bk-row ~ .bk-row label{display:none}
.bk-rows + .btn{margin-top:4px}
/* Only the first row carries labels, so only its Remove needs to clear them. */
.bk-row ~ .bk-row > .btn{margin-top:0}

/* The invoice row's actions. They used to run together — "PDFPayment slip"
   followed by three buttons with nothing between them (Dan, 20 Oct). A row of
   its own, wrapping on a narrow screen rather than squeezing the table. */
.rowacts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.rowacts a{white-space:nowrap;align-self:center}

/* The invoice letter, previewed in the editor. Sandboxed and inert: it is a
   document we rendered, shown so it is read before it is sent. */
.m-preview{width:100%;height:420px;border:1px solid var(--line-soft);border-radius:8px;background:#fff;margin-top:8px}
/* A-03: the one action that lives inside a table cell. */
.rowact{margin-top:6px}
.rowact .btn{height:30px;padding:0 12px;font-size:12px}
