/* Compact controls for Lists admins and shared purchase drafts. */
/* Catalogue toolbar: words on every button and a search field that is always
   open (audit F15). Same selectors as the base rules in index.html, so these win
   by load order rather than by !important. */
.pane-tools{flex-wrap:wrap;justify-content:flex-end;min-width:0}
.btn.btn-sm.catalogue-action,.btn.btn-sm.catalogue-action.expanded,#cat-table-toggle{
  width:auto;min-width:44px;height:44px;padding:0 14px;gap:8px;border-radius:999px}
.catalogue-action span,.catalogue-action.expanded span{max-width:none;opacity:1}
.pane-head .search,.pane-head .search:focus-within{
  flex:0 1 260px;width:260px;max-width:100%;height:44px;border-radius:999px;cursor:text}
.pane-head .search svg{left:14px;width:17px;height:17px}
.pane-head .search input{opacity:1;pointer-events:auto;cursor:text;padding:0 14px 0 40px}
.pane-head .search input::-webkit-search-cancel-button{cursor:pointer}
.card .edit{opacity:1;pointer-events:auto}.card .edit button{width:44px;height:44px}
.card .edit .del{display:none}.card .pic{height:135px}.card .body .note{white-space:normal}
.line .tx b,.line .tx>span{white-space:normal;overflow:visible;text-overflow:clip}
.typed-qty{width:64px!important;min-height:44px;text-align:center;border:1px solid var(--line);border-radius:6px;background:var(--sag-surface);color:var(--ink);font:inherit;font-weight:700;padding:4px}
.step button,.line-act .rm,.line-act .tag-btn{min-width:44px;min-height:44px}.line-act{flex-wrap:wrap}
.card-step-q.typed-qty{width:64px!important}.catalogue-search-scope{grid-column:1/-1;margin:8px 0;color:var(--muted)}
.admin-table-wrap{overflow:auto;max-width:100%;border:1px solid var(--line);border-radius:12px;background:var(--sag-surface)}
.admin-queue,.admin-queue-tools,#admin-work-table{min-width:0;max-width:100%}.admin-table-wrap{min-width:0;width:100%}
.admin-queue .pane-tools-labels{display:flex;flex-wrap:wrap;flex:1 1 100%;width:100%;min-width:0;justify-content:flex-start}
.admin-queue .pane-tools-labels .btn{width:auto;flex:0 1 auto;min-width:0;white-space:normal;min-height:44px}
.admin-presets{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.admin-presets .btn{min-height:44px}
.admin-table{width:100%;border-collapse:collapse;font-size:13px;user-select:text}
.admin-table th{position:sticky;top:0;z-index:1;background:var(--sag-selected);color:var(--ink);text-align:left;white-space:nowrap;padding:12px;font-size:12px}
.admin-table td{padding:12px;border-top:1px solid var(--line);vertical-align:top}.admin-table .num{text-align:right;white-space:nowrap}
.admin-table .admin-next{position:sticky;right:0;min-width:175px;background:var(--sag-surface);box-shadow:-2px 0 5px #0001}.admin-next .btn{display:block;margin-bottom:6px}
.admin-table .admin-items{min-width:220px;max-width:430px;white-space:normal}.admin-table .btn{min-height:44px;white-space:nowrap}
/* An even grid, so a filter that wraps does not stretch across a row alone. */
.admin-filters{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;margin:12px 0}
.admin-filter{display:flex;flex-direction:column;gap:5px;min-width:0}.admin-filter:first-child{grid-column:span 2}
.admin-filter input:focus-visible,.admin-filter select:focus-visible{outline:none;border-color:var(--sag-primary,var(--sag-text));box-shadow:0 0 0 3px rgba(27,48,56,.12)}
.admin-filter span{font-size:12px;font-weight:700}.admin-filter input,.admin-filter select{min-height:44px;padding:8px;border:1px solid var(--sag-line-strong,var(--sag-line-strong));border-radius:8px;font:inherit;background:var(--sag-surface);color:var(--ink);min-width:0}
.admin-empty{padding:24px;background:var(--sag-surface);border:1px solid var(--line);border-radius:12px}
.admin-queue #admin-work-table~.mg-section:not(:has(.mg-unsent)){display:none}
.admin-queue .mg-section:has(.mg-unsent){margin-top:24px}.admin-queue .mg-none{display:none!important}
.admin-catalogue-toolbar{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:12px}
.catalogue-table input{min-height:44px;width:100%;min-width:80px;border:1px solid transparent;border-radius:6px;padding:8px;font:inherit;background:transparent}
.catalogue-table input:focus{background:var(--sag-surface);border-color:var(--gold)}.catalogue-table input:disabled{color:var(--muted)}
.catalogue-table td:first-child{min-width:180px}.catalogue-table .admin-changed{background:var(--sag-wait-bg)}
#grid:has(.catalogue-table),#grid:has(.catalogue-search-scope){display:block}#grid:has(.catalogue-search-scope){display:grid}
.shared-selection{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:18px}
.shared-selection legend{font-weight:700}.shared-selection p{font-size:12px;color:var(--muted)}
.shared-selection label{display:flex;align-items:center;gap:10px;padding:8px;border-bottom:1px solid var(--line)}
.shared-selection input{width:22px;height:22px;flex:none}.shared-selection label:last-child{border:0}
.invoice-queue-card{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px;padding:16px;margin:12px 0;border:1px solid var(--line);border-radius:12px;background:var(--sag-surface)}
.invoice-queue-card.is-dragging{border-color:var(--sag-line-strong,var(--sag-line-strong));background:var(--sag-hover,#EEF2F4)}
.invoice-queue-actions .inv-kinds{display:block;margin-top:4px;font-size:12px;color:var(--muted)}
.invoice-queue-card h3{margin:0 0 8px}.invoice-queue-card p{margin:5px 0;font-size:13px;overflow-wrap:anywhere}.invoice-queue-actions{display:flex;flex-direction:column;gap:10px;min-width:150px}
.invoice-queue-actions span{font-size:12px;color:var(--muted)}.invoice-queue-actions button{min-height:44px}
.push-setup{padding:10px 14px!important}.push-setup .push-copy p{display:none}.push-setup .push-actions{margin-top:0}
.price-note{padding:10px 14px}.howto{padding:8px 12px}.panel{max-height:calc(100dvh - 94px);display:flex;flex-direction:column}
.panel-body{overflow:auto;min-height:0;flex:1}.panel #budget{flex:none;max-height:165px;overflow:auto}.panel-ft{flex:none;position:sticky;bottom:0;background:var(--paper,var(--sag-surface));z-index:2}
@media(min-width:1081px){.panel{position:sticky;top:82px}.line{align-items:flex-start;flex-wrap:wrap}.line .tx{min-width:140px}.line-act{margin-left:auto}}
@media(max-width:900px){.panel{max-height:calc(100dvh - 50px)}.admin-filters{gap:8px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.pane-tools{width:100%;justify-content:flex-start}.pane-head .search,.pane-head .search:focus-within{flex:1 1 100%;width:100%}.card .pic{height:110px}.push-setup .push-title{font-size:13px}.push-setup svg{display:none}.push-setup .push-copy{max-width:100%}.price-note .price-note-detail{display:none}}
/* "Request items · Budget · Work queue" no longer fits beside the logo and the
   icons on a phone, so the tabs take a row of their own. measureTopbar() reads
   the new height, so the sticky headers below still line up. The worker injects
   its own phone rules after this file (sag-mobile-viewport-containment), hence
   the .topbar-in prefix. */
@media(max-width:480px){.topbar-in{flex-wrap:wrap;row-gap:8px}
  .topbar-in>.nav{order:10;flex:1 1 100%;min-width:0;overflow:visible}
  .topbar-in>.lang{margin-left:auto}
  .topbar-in>.nav button{flex:1 1 0;padding:8px 6px;font-size:12.5px;min-height:40px}
  .pane-tools>.btn{flex:1 1 auto}}
@media(max-width:360px){.admin-filter:first-child{grid-column:auto}}
@media(max-width:600px){.invoice-queue-card{flex-direction:column;align-items:stretch}.invoice-queue-actions{min-width:0}.cats{flex-wrap:wrap}.cat{flex:1 1 42%;min-width:130px}}

/* The attachment and its reading stay together in the side panel. */
.inv-read-preview{display:flex;width:100%;align-items:center;justify-content:center;flex-direction:column;gap:10px;padding:14px;border:1px solid var(--line,#dce3e5);border-radius:14px;background:#f7f9f9;color:var(--ink,#1c3139);font:inherit;cursor:pointer}
.inv-read-preview img{display:block;max-width:100%;max-height:260px;object-fit:contain;border-radius:6px}
.inv-read-preview>span:last-child{text-decoration:underline;text-underline-offset:3px}
.inv-read-original{display:block;margin:6px auto 0;border:0;background:none;padding:4px 6px;font:inherit;font-size:13px;color:var(--muted,#5f7177);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.inv-read-original:hover{color:var(--ink,#1c3139)}
.inv-read-preview:hover,.inv-read-preview:focus-visible{border-color:#b78b17;outline:2px solid #efcf7a;outline-offset:2px}
.inv-read-pdf{font-size:28px;font-weight:700;padding:20px}
.inv-reading{margin-top:22px;min-width:0}
.inv-reading h3,.inv-filed h3{margin:0 0 10px}
.inv-reading [data-reading-status]{color:var(--sag-text-3);font-size:.93em}
.inv-reading .inv-read-error{color:#a13820}
.inv-read-pages{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:12px 0}
.inv-read-pages .btn{white-space:normal;text-align:left}
.inv-read-pages select{font:inherit;border:1px solid #ccd6d9;border-radius:8px;padding:6px;background:var(--sag-surface)}
.inv-read-facts{color:var(--sag-text-3);font-size:.88em;overflow-wrap:anywhere}
.inv-read-items{list-style:none;padding:0;margin:14px 0}
.inv-read-items li{display:flex;align-items:baseline;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid #e5eaec}
.inv-read-items li span{overflow-wrap:anywhere;min-width:0}
.inv-read-items li b{white-space:nowrap;font-weight:600}
.inv-read-total{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-top:2px solid #cbd6d9}
.inv-read-text{margin:16px 0;overflow-wrap:anywhere}
.inv-read-text summary{cursor:pointer;padding:8px 0;font-weight:600}
.inv-read-text .rc-read-lines{max-height:340px;overflow:auto}
.inv-reading [data-reading-retry]{margin-top:8px}
.inv-filed{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid #dce3e5}
/* The petty cash statement, read like a bank statement: a missing receipt stands out, and the opening and closing rows frame it. */
.stmt-hd{margin-top:16px;align-items:center}
.stmt-hd .stmt-export{margin-left:auto}
.stmt .stmt-proof.missing{color:#9c3f2f;font-weight:700}
.stmt tr.stmt-edge td{background:var(--surface-2,#f6f7f5)}
