/* Spárováno product UI. Shared visual contract from the approved comparison pilot.
   Server-rendered forms retain their routes, CSRF fields and permission guards. */
:root {
  --ui-bg:#17191d; --ui-panel:#202328; --ui-control:#17191d; --ui-hover:#2a2e35;
  --ui-line:#34383f; --ui-input-line:#454b55; --ui-text:#f5f5f6; --ui-muted:#a8b0bc;
  --ui-font:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
:root[data-admin-theme=light] {
  --ui-bg:#fff; --ui-panel:#fafafa; --ui-control:#fff; --ui-hover:#f2f4f7;
  --ui-line:#e4e7ec; --ui-input-line:#d0d5dd; --ui-text:#181d27; --ui-muted:#535862;
}
body.admin {
  --bg:var(--ui-bg); --panel:var(--ui-panel); --card:var(--ui-bg); --control:var(--ui-hover);
  --card-2:var(--ui-hover); --border:var(--ui-line); --text:var(--ui-text); --muted:var(--ui-muted);
  --font:var(--ui-font); --font-head:var(--ui-font); --radius:12px;
  background:var(--bg); color:var(--text); font-family:var(--ui-font); font-size:14px; line-height:1.5;
}
body.admin :is(h1,h2,h3,h4,input,textarea,select,button) {font-family:var(--ui-font);font-stretch:normal}
body.admin h1 {font-size:28px;letter-spacing:-.7px;line-height:1.25;font-weight:600;margin-bottom:24px}
body.admin h2 {font-size:18px;letter-spacing:-.25px;line-height:1.4;font-weight:600}
body.admin h3 {font-size:15px;letter-spacing:0;font-weight:600}
body.admin :is(.muted,.access-intro,.page-subtitle) {color:var(--muted);font-size:13px;line-height:1.6}
body.admin :is(.btn,button.linklike) {font-size:13px;font-weight:600;line-height:20px}
body.admin .btn {min-height:40px;padding:9px 14px;border-radius:8px;gap:7px;transition:background-color .15s,border-color .15s;color:var(--text);box-shadow:none}
:root body.admin .btn.btn-primary {color:#fff!important;background:var(--accent);border-color:var(--accent)!important}
body.admin .btn-primary:hover {filter:brightness(.94)}
body.admin .btn-primary :is(svg,.icon) {color:#fff;stroke:currentColor}
body.admin .btn-ghost {background:transparent}
body.admin :is(.btn,.linklike) .icon {width:16px;height:16px;flex:none}
body.admin label {font-size:13px}
body.admin :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]):not([type=file]),textarea,select,.lp-select-toggle) {
  background:var(--ui-control);color:var(--text);border:1px solid var(--ui-input-line);border-radius:8px;
  font-size:14px;line-height:20px;min-height:40px;box-shadow:none;
}
body.admin :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]):not([type=file]),textarea,select) {padding:9px 12px}
body.admin :is(input,textarea,select):focus-visible {outline:2px solid color-mix(in srgb,var(--accent) 65%,transparent);outline-offset:2px}
body.admin :is(select,.lp-select-toggle,.lp-select-option,.checkbox,.notify-scope label) {font-size:14px;line-height:20px}
body.admin .lp-select-toggle {padding:9px 12px;min-height:40px}
body.admin .lp-select-panel {background:var(--panel);border:1px solid var(--ui-input-line);border-radius:10px;padding:5px;box-shadow:0 10px 30px #0003}
body.admin .lp-select-option {border-radius:6px;padding:9px 10px;min-height:36px}
body.admin :is(.card,.review-queue,.inbox-address-card,.store-overview,.access-person,.access-device,.billing-card) {background:var(--card);border:1px solid var(--border);border-radius:12px;box-shadow:none}
body.admin :is(.table-wrap,.company-table-scroll) {border:1px solid var(--border);border-radius:12px;overflow-x:auto}
body.admin table {font-variant-numeric:tabular-nums}
body.admin th {background:var(--panel);color:var(--muted);font-size:12px;font-weight:500;letter-spacing:0;text-transform:none}
body.admin :is(th,td) {border-color:var(--border);padding:12px 16px}
body.admin td {font-size:13px;line-height:20px}
body.admin tbody tr:hover {background:var(--ui-panel)}
body.admin .day-table :is(th,td) {padding-block:12px}
body.admin :is(.toolbar,.toolbar-filters,.supplier-toolbar) {gap:12px;align-items:flex-end}
body.admin :is(.month-title,.month-name) {font-size:17px;font-weight:600;letter-spacing:-.2px}
body.admin :is(.access-tabs,.supplier-tabs,.account-tabs,.inbox-tabs) {gap:24px;border-bottom:1px solid var(--border)}
body.admin :is(.access-tabs,.supplier-tabs,.account-tabs,.inbox-tabs)>a {padding:12px 0;background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--muted);font-size:13px}
body.admin :is(.access-tabs,.supplier-tabs,.account-tabs,.inbox-tabs)>a[aria-current] {border-bottom-color:var(--accent);color:var(--text);font-weight:600;background:none}
body.admin :is(.alert,.notice,.flash) {border-radius:8px;font-size:13px;line-height:1.5}
body.admin :is(.empty-state,.people-filter-empty,.supplier-empty,.inbox-empty,.delivery-empty) {padding:24px;border:1px solid var(--border);border-radius:10px;background:var(--panel);font-size:13px;color:var(--muted)}
body.admin :is(dialog,.entity-dialog,.member-dialog,.courier-dialog,.modal-dialog) {color:var(--text);background:var(--panel);border:1px solid var(--border);border-radius:16px;box-shadow:0 20px 70px #0004}
body.admin dialog::backdrop {background:#080c13b3;backdrop-filter:blur(4px)}
body.admin :is(.entity-editor-heading,.member-dialog-head,.modal-header) {padding:22px 24px;border-bottom:1px solid var(--border)}
body.admin :is(.entity-dialog-scroll,.member-dialog-body) {padding:24px}
body.admin :is(.entity-form-actions,.member-dialog-actions) {padding:16px 24px;border-top:1px solid var(--border);gap:10px;display:flex;justify-content:flex-end;align-items:center}
body.admin :is(.entity-editor-heading,.member-dialog-head,.modal-header) h2 {font-size:18px;margin:0}
body.admin :is(.entity-dialog-close,.member-dialog-close,.modal-close:not(.document-modal-close)) {display:inline-flex;align-items:center;justify-content:center;padding:0;width:36px;height:36px;min-height:36px;line-height:1;border:0;border-radius:50%;background:var(--control);color:var(--muted);transition:background .15s,color .15s}
body.admin :is(.entity-dialog-close,.member-dialog-close,.modal-close:not(.document-modal-close)):hover {background:var(--ui-input-line);color:var(--text)}
body.admin :is(.entity-dialog-close,.member-dialog-close,.modal-close:not(.document-modal-close))>svg {width:18px;height:18px;display:block}
/* Stable shell: company operations above, cross-company administration below. */
body.admin-workspace {--sidebar-width:248px}
body.admin-workspace>main {margin-left:var(--sidebar-width);max-width:none;padding:30px 36px 48px}
body.admin-workspace>main>section {max-width:none}
body.admin-workspace .workspace-sidebar {background:var(--panel);padding:24px 14px 16px;gap:24px;overflow-y:auto;border-right:1px solid var(--border)}
.workspace-brand-row {display:flex;align-items:center;gap:8px;flex:none;min-height:28px}
body.admin .workspace-brand-row .workspace-brand {padding:0;min-width:0;flex:1;opacity:1;min-height:28px}
body.admin .workspace-brand-row .workspace-brand img {max-width:166px;width:100%;max-height:28px;object-fit:contain;object-position:left center}
body.admin .workspace-brand-row .workspace-collapse {position:static;flex:none;width:28px;height:28px;min-height:28px;padding:4px;margin:0;border:0;background:transparent;color:var(--muted);border-radius:6px}
body.admin .workspace-brand-row .workspace-collapse:hover {background:var(--control);color:var(--text)}
body.admin .workspace-company-caption {padding:0;font-size:11px;margin:0 0 7px}
body.admin .workspace-switcher>summary {min-height:54px;border:0;background:color-mix(in srgb,var(--text) 5%,var(--panel));border-radius:10px;padding:11px;gap:8px;box-shadow:none;transition:background-color .15s}
body.admin .workspace-switcher>summary strong {font-size:13px;line-height:20px;white-space:nowrap;text-overflow:ellipsis;display:block;overflow:hidden}
body.admin .workspace-switcher>summary>.icon {color:var(--accent);width:18px;height:18px}
body.admin .workspace-sidebar>nav {flex:1;min-height:80px;overflow-y:auto;overflow-x:hidden;display:block}
body.admin .workspace-sidebar nav a,body.admin .workspace-account-settings>summary,body.admin .workspace-company-settings>summary {min-height:38px;padding:9px 11px;font-size:13px;line-height:20px;gap:10px;font-weight:500}
body.admin .workspace-sidebar nav a[aria-current] {background:var(--accent-soft);font-weight:600;color:var(--text)}
body.admin .workspace-sidebar nav a[aria-current]:before {width:3px;top:10px;bottom:10px}
/* Keep neighbouring active/hover surfaces separate in every sidebar mode. */
body.admin .workspace-sidebar nav>a+a {margin-top:4px}
body.admin .workspace-account-settings nav {display:block}
body.admin .workspace-sidebar nav .icon {width:18px;height:18px}
.workspace-section-label {font-size:10px;letter-spacing:1px;color:var(--muted);margin:2px 10px 12px;text-transform:uppercase}
body.admin .workspace-company-settings {margin-top:12px}
body.admin .workspace-company-settings>summary {display:flex;align-items:center;list-style:none;cursor:pointer;border-radius:8px;font-size:14px}
.workspace-company-settings>summary::-webkit-details-marker {display:none}
.workspace-company-settings>summary>span:first-of-type {flex:1}
.workspace-company-settings>summary:hover {background:var(--control)}
.workspace-company-settings[open] .workspace-settings-arrow {transform:rotate(225deg)}
body.admin .workspace-company-settings nav {display:block;margin-top:4px}
body.admin .workspace-company-settings nav a {padding-left:39px;min-height:36px;font-size:13px;font-weight:400}
body.admin .workspace-sidebar .workspace-footer {display:grid;gap:3px;margin-top:0;padding-top:16px;border-top:1px solid var(--border);flex:none}
body.admin .workspace-footer .workspace-section-label {margin-bottom:7px}
body.admin .workspace-footer .workspace-management {display:block}
:root body.admin .workspace-sidebar .workspace-footer .workspace-credit {border:0;border-radius:8px;padding:12px 10px;margin-top:6px;font-size:12px;background:color-mix(in srgb,var(--text) 4%,var(--panel));box-shadow:none;transition:background-color .15s}
:root body.admin .workspace-sidebar .workspace-footer .workspace-credit:hover {background:color-mix(in srgb,var(--text) 7%,var(--panel))}
:root body.admin .workspace-sidebar .workspace-footer .workspace-credit::before {content:none}
body.admin .workspace-credit strong {font-size:12px}
body.admin .workspace-logout button {font-size:13px;min-height:40px;padding:10px;gap:10px;color:var(--muted)}
body.admin .workspace-account-settings nav a {font-size:13px;padding:8px 10px 8px 39px;min-height:36px}
body.admin .workspace-switcher-panel {top:155px;padding:0 14px 18px;background:var(--panel)}
body.admin .workspace-switcher-panel .workspace-switch-heading h2 {font-size:16px}
body.admin .workspace-companies button {font-size:13px;min-height:44px}
.workspace-context-bar {margin-left:var(--sidebar-width);min-height:58px;padding:14px 36px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;font-size:12px;color:var(--muted)}
.workspace-context-bar strong {color:var(--text);font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-context-bar .context-separator {color:var(--ui-input-line)}
.workspace-context-bar .context-company {margin-left:auto;max-width:35%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.admin .first-steps-welcome {padding:12px 16px;margin-bottom:24px;background:var(--panel);border-radius:10px}
body.admin .first-steps-welcome :is(p,.btn) {font-size:12px}
/* Directory filters are a single form; GET parameters preserve sorting and period. */
body.admin .company-directory-filters {padding-bottom:18px;border-bottom:1px solid var(--border)}
body.admin .office-page .company-search-row {display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(180px,1fr) minmax(180px,1fr) auto;align-items:end;gap:14px}
body.admin .company-search-row>label,body.admin .company-search-row .company-processing-filter {display:grid;gap:6px;min-width:0;max-width:none;font-size:12px;color:var(--muted)}
body.admin .company-search-row :is(input,select,.lp-select-toggle) {height:40px;min-height:40px;background:var(--bg);font-size:14px}
body.admin .company-extra-filters {border:0;padding:0;margin-top:12px}
body.admin .company-extra-filters>summary {min-height:30px;font-size:12px;justify-content:flex-start;display:inline-flex}
body.admin .company-extra-filters>summary:after {margin-left:8px}
body.admin .company-extra-filters>summary>span {font-size:12px}
body.admin .office-page .company-filter-fields {grid-template-columns:repeat(4,minmax(120px,1fr));max-width:900px;padding-top:12px;gap:12px}
.company-filter-status {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px;font-size:12px}
.company-filter-status a {padding:5px 8px;background:var(--control);border:0;border-radius:5px;color:var(--text);text-decoration:none;display:inline-flex;align-items:center;gap:8px}
.company-filter-status a:hover {background:var(--ui-input-line)}
.company-filter-status .company-reset-all {margin-left:auto;background:none;color:var(--muted)}
body.admin .company-table thead th {background:var(--panel);height:38px;font-size:12px}
body.admin .company-table tbody th {background:transparent;font-size:13px;font-weight:600}
body.admin .company-table tbody :is(th,td) {height:54px;padding:10px 16px}
body.admin .company-table tbody tr {--company-row-background:var(--bg)}
body.admin .company-table tbody tr:hover {--company-row-background:var(--panel)}
body.admin .company-processing {font-size:12px}
.company-mode-badge {display:inline-flex;padding:2px 7px;border-radius:999px;font-size:11px;white-space:nowrap;border:1px solid var(--border);line-height:18px;color:var(--text)}
.company-mode-quality {background:#155eef1c;color:#84adff;border-color:#155eef66}
.company-mode-header {background:#0794551a;color:#75e0a7;border-color:#07945555}
.company-mode-full {background:#7f56d91a;color:#d6bbfb;border-color:#7f56d955}
:root[data-admin-theme=light] .company-mode-quality {color:#1849a9}
:root[data-admin-theme=light] .company-mode-header {color:#067647}
:root[data-admin-theme=light] .company-mode-full {color:#6941c6}
/* People keep the real per-company editors; long grants open in a focused disclosure. */
body.admin .uzivatele .member-list {background:var(--bg);border-radius:12px;overflow:visible}
body.admin .uzivatele .member-card {background:transparent;border-radius:0;padding:16px 20px;margin:0;border:0;border-bottom:1px solid var(--border)}
body.admin .uzivatele .member-card:last-child {border-bottom:0}
body.admin .uzivatele .member-identity h2 {font-size:13px;line-height:20px}
body.admin .uzivatele .member-email {font-size:12px;line-height:18px}
body.admin .uzivatele .member-avatar {width:36px;height:36px;flex-basis:36px}
body.admin .uzivatele .member-actions .btn {font-size:12px;min-height:36px;padding:7px 10px}
.people-access-disclosure {min-width:0}
.people-access-disclosure>summary {list-style:none;display:flex;align-items:center;gap:12px;cursor:pointer;min-height:38px;font-size:13px;padding:2px 0}
.people-access-disclosure>summary::-webkit-details-marker {display:none}
.people-access-count {font-weight:600;display:flex;align-items:center;gap:8px}
.people-access-count:after {content:'';width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-top:-3px}
.people-access-disclosure[open] .people-access-count:after {transform:rotate(225deg);margin-top:3px}
.people-access-description {color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:380px}
.people-access-disclosure[open]>summary {padding-bottom:12px;border-bottom:1px solid var(--border);margin-bottom:6px}
body.admin .people-access-disclosure .person-firms-list {max-height:340px;overflow-y:auto;padding-right:4px}
body.admin .people-access-disclosure .office-edit-affordance {font-size:12px}
body.admin .people-filters {margin:0 0 18px}
body.admin .people-filter-controls {gap:12px;align-items:end}
/* Functional pages share the same spacing and surface hierarchy. */
body.admin :is(.delivery-page,.inbox-page,.processing-page,.account-page,.billing-page,.store-overview-page,.supplier-page,.payment-overview-page) {max-width:none}
body.admin :is(.documents-heading,.supplier-page-head,.inbox-heading,.store-overview-head,.access-hub-heading) {margin-bottom:24px}
body.admin :is(.documents-heading,.supplier-page-head,.inbox-heading,.store-overview-head,.access-hub-heading) h1 {margin:0}
body.admin .day-group {margin-top:24px}
body.admin .review-heading h2 {font-size:16px}
body.admin .document-modal {background:var(--bg)}
body.admin .document-modal .detail-data>.card {background:var(--panel)}
body.admin .doklad-detail .detail-grid {gap:24px}
body.admin .doklad-detail :is(.card,.detail-section) {border-radius:12px}
/* Stores use a page heading and one list surface, like scanner accounts. */
body.admin .store-overview {padding:0;border:0;background:transparent;border-radius:0;box-shadow:none}
body.admin .store-overview .stores-scanner-bar {padding:0;min-height:44px;border:0;border-radius:0;background:transparent;margin-bottom:24px}
body.admin .login-card {max-width:440px;width:100%;box-sizing:border-box;background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:32px}
body.admin .login-card h1 {font-size:26px}
body.admin.platform-page .platform-shell {max-width:1480px}
body.admin.platform-page .platform-bar {background:var(--panel);border:1px solid var(--border);border-radius:12px}
body.admin.platform-page :is(.platform-card,.platform-section) {background:var(--card);border-radius:12px;border-color:var(--border)}
@media(min-width:901px) {
  :root[data-sidebar=collapsed] body.admin-workspace {--sidebar-width:76px}
  :root[data-sidebar=collapsed] body.admin .workspace-sidebar {padding-inline:10px}
  :root[data-sidebar=collapsed] .workspace-company-header {display:block}
  :root[data-sidebar=collapsed] body.admin .workspace-switcher>summary {width:48px;min-height:48px;padding:12px}
  :root[data-sidebar=collapsed] .workspace-brand-row {flex-direction:column;gap:10px}
  :root[data-sidebar=collapsed] body.admin .workspace-brand-row .workspace-brand {flex:none;width:18px;min-height:22px;overflow:hidden;display:block;padding:4px 0}
  :root[data-sidebar=collapsed] body.admin .workspace-brand-row .workspace-brand img {max-width:none;width:164px;height:auto}
  :root[data-sidebar=collapsed] .workspace-section-label,
  :root[data-sidebar=collapsed] .workspace-company-settings>summary>span,
  :root[data-sidebar=collapsed] .workspace-company-settings>nav {display:none}
  :root[data-sidebar=collapsed] body.admin .workspace-company-settings>summary {justify-content:center;padding:10px}
  :root[data-sidebar=collapsed] body.admin .workspace-sidebar>nav {min-height:100px}
  :root[data-sidebar=collapsed] body.admin .workspace-sidebar :is(.workspace-switcher>summary,nav>a,.workspace-management button,.workspace-account-settings>summary,.workspace-company-settings>summary,.workspace-credit,.workspace-logout button) {width:48px;margin-inline:auto;justify-content:center}
  :root[data-sidebar=collapsed] body.admin .workspace-footer .workspace-management {border-top:0;padding-top:0}
  :root[data-sidebar=collapsed] .workspace-context-bar {margin-left:76px}
}
@media(max-width:1150px) and (min-width:901px) {
  body.admin-workspace {--sidebar-width:224px}
  body.admin-workspace>main,.workspace-context-bar {padding-inline:24px}
  body.admin .workspace-brand-row .workspace-brand img {max-width:150px}
  body.admin .office-page .company-search-row {grid-template-columns:1fr 1fr auto}
  body.admin .company-search-row>label:first-child {grid-column:1/-1}
}
@media(max-width:900px) {
  body.admin-workspace>main {margin-left:0;padding:24px 20px 40px}
  .workspace-context-bar {display:none}
  body.admin .workspace-sidebar {width:min(280px,85vw);gap:20px;padding-top:18px}
  body.admin .workspace-brand-row .workspace-brand img {max-width:164px}
  body.admin .workspace-menu-close {position:absolute;top:14px;right:12px;z-index:3;width:32px;height:32px;padding:0;font-size:0;display:flex;align-items:center;justify-content:center}
  .workspace-brand-row {padding-right:32px}
  body.admin .workspace-mobile-bar {min-height:58px;padding:8px 14px;background:var(--panel)}
  body.admin .workspace-mobile-bar>.btn {min-height:40px}
  body.admin .workspace-switcher-panel {top:155px}
  body.admin .office-page .company-search-row {grid-template-columns:1fr 1fr auto}
  body.admin .company-search-row>label:first-child {grid-column:1/-1}
}
@media(max-width:600px) {
  body.admin-workspace>main {padding:22px 16px 40px}
  body.admin h1 {font-size:25px;letter-spacing:-.5px}
  body.admin .btn {min-height:42px;font-size:13px;padding:10px 12px}
  body.admin :is(input,textarea,select,.lp-select-toggle) {font-size:16px!important}
  body.admin :is(dialog,.entity-dialog,.member-dialog,.courier-dialog) {border-radius:14px;max-width:calc(100vw - 24px)}
  body.admin :is(.entity-editor-heading,.member-dialog-head,.modal-header,.entity-dialog-scroll,.member-dialog-body) {padding:20px}
  body.admin :is(.entity-form-actions,.member-dialog-actions) {padding:16px 20px;flex-wrap:wrap}
  body.admin .office-page .company-search-row {grid-template-columns:1fr;gap:12px}
  body.admin .company-search-row>label:first-child {grid-column:auto}
  body.admin .company-search-row>.btn {justify-self:start}
  body.admin .office-page .company-filter-fields {grid-template-columns:1fr 1fr}
  body.admin .company-extra-filters>summary>span {font-size:11px}
  body.admin .company-table {min-width:780px}
  .people-access-disclosure>summary {align-items:flex-start;flex-direction:column;gap:4px;padding:6px 0}
  .people-access-description {max-width:100%;white-space:normal}
  body.admin .uzivatele .member-card {padding:16px}
  body.admin :is(.alert,.notice,.flash) {overflow-wrap:anywhere}
  body.admin .login-card {padding:24px}
}
@media(prefers-reduced-motion:reduce) {body.admin * {scroll-behavior:auto!important;transition:none!important}}
/* Compact, consistent directory rows override the legacy card variants. */
:root body.admin .uzivatele.people-directory .member-list {border:1px solid var(--border);border-radius:12px}
:root body.admin .uzivatele.people-directory .member-list>.member-card {margin:0;border:0;border-bottom:1px solid var(--border);border-radius:0;padding:16px 20px;background:transparent;box-shadow:none;gap:20px}
:root body.admin .uzivatele.people-directory .member-list>.member-card:last-child {border-bottom:0}
body.admin .people-directory .member-card>.member-card-head {padding-top:0;align-items:center}
body.admin .office-person-access:has(.people-access-disclosure) {position:relative;padding:0}
body.admin .office-person-access:has(.people-access-disclosure)>.person-company-picker {position:absolute;right:0;top:0;margin:0;padding:0;border:0}
body.admin .office-person-access:has(.people-access-disclosure)>.person-company-picker>summary {padding:9px 0;font-size:12px}
.people-access-disclosure>summary {padding-right:135px;font-weight:400}
.people-access-description {font-weight:400;min-width:0;flex:1}
.people-access-count {flex:none}
body.admin .review-document a,body.admin .review-amount {font-size:14px}
body.admin :is(.review-location,.review-payment,.review-next,.review-status) {font-size:12px}
body.admin .review-action .review-open {font-size:12px;min-height:36px;padding:7px 12px}
body.admin .review-list td {padding:12px 20px}
body.admin .review-list th {font-size:12px}
body.admin .delivery-settings>summary {padding:12px 16px;font-size:13px;background:var(--panel)}
body.admin .delivery-page .eyebrow {font-size:11px;color:var(--muted);margin-bottom:6px}
body.admin .delivery-page .page-head h1 {margin-bottom:8px}
body.admin .delivery-page .page-head {margin-bottom:24px}
body.admin .delivery-page .form-grid {gap:14px}
body.admin .delivery-page .card {padding:20px}
body.admin .delivery-page .card h2 {margin:0 0 16px}
body.admin .delivery-tabs>a {font-size:13px}
body.admin .delivery-tabs>a[aria-current] {border-bottom-color:var(--accent)}
body.admin .entity-dialog .entity-form-actions {position:sticky;bottom:-24px;background:var(--panel);z-index:3;margin-inline:-24px;padding:14px 24px;margin-bottom:-24px}
@media(min-width:1200px) {
 body.admin .delivery-settings[open] {display:grid;grid-template-columns:1.2fr 1fr;gap:16px;max-width:none}
 body.admin .delivery-settings>summary {grid-column:1/-1}
 body.admin .delivery-settings>section {margin:0;align-self:start}
}
@media(max-width:700px) {
 :root body.admin .uzivatele.people-directory .member-list>.member-card {padding:16px;gap:8px}
 body.admin .people-directory .member-card>.member-card-head {border:0;padding:0}
 .people-access-disclosure>summary {padding-right:120px;min-height:40px}
 .people-access-description {display:none}
 body.admin .entity-dialog .entity-form-actions {bottom:-20px;margin-inline:-20px;margin-bottom:-20px;padding:14px 20px}
 body.admin .review-list td {padding:0}
 body.admin .delivery-page .card {padding:16px}
}
body.admin.page-admin-login .login-sub {font-size:12px;color:var(--muted);margin:10px 0 24px}
body.admin.page-admin-login .login-logo {max-width:200px}
body.admin.page-admin-login .login-card h1 {margin-bottom:8px}
body.admin.page-admin-login .login-links {font-size:13px}
body.admin.page-admin-login .login-help {font-size:13px}
body.admin.page-admin-login main {justify-content:center;align-items:center;gap:24px}
body.admin.page-admin-login .login-card {margin:0}
body.admin .registration-card {background:var(--panel);border-color:var(--border);box-shadow:none}
:root body.admin .registration-steps li[aria-current] .registration-step-number {background:var(--accent);border-color:var(--accent);color:#fff}
body.admin .btn.workspace-menu-close {width:32px;height:32px;min-height:32px;padding:0;border:0;border-radius:50%;background:var(--control);font-size:0}
body.admin .btn.workspace-menu-close:hover {background:var(--hover)}
body.admin .payment-overview-page {--pay-surface:var(--bg);--pay-line:var(--border);--pay-muted:var(--muted);--pay-soft:var(--control)}
body.admin .payment-overview-page .page-title {font-size:28px}
body.admin .payment-search-group {border:0;background:transparent;box-shadow:none;padding:0}
body.admin .payment-list {padding-inline:20px}
body.admin .payment-list-total {padding:16px 20px}
body.admin .payment-list-total>strong {font-size:22px}
body.admin .payment-list-row {padding:12px 0}
body.admin .payment-list-row>div:first-child>strong {margin-bottom:0}
body.admin .payment-list-row>div:first-child>a {min-height:24px;padding:3px 0}
body.admin .payment-list-row>div:first-child>a+small {display:inline-block;margin-left:8px}
body.admin .payment-list-row>div:first-child>a+small::before {content:'·';margin-right:8px}
body.admin .payment-empty {min-height:200px;padding:32px 20px;gap:14px}
@media(max-width:600px) {
 body.admin .payment-list-row>div:first-child>a {min-height:44px;padding:12px 0}
 body.admin .payment-overview-page .page-title {font-size:25px}
}
@media print {
  body.admin {--bg:#fff;--panel:#fff;--card:#fff;--text:#111;--muted:#555;--border:#ddd;background:#fff;color:#111}
  .workspace-context-bar,.company-directory-filters,.people-filters {display:none}
  body.admin-workspace>main {margin:0;padding:0}
}

:root {--scroll-thumb:#505762;--scroll-thumb-hover:#727b89;--scroll-thumb-active:#909baa}
:root[data-admin-theme=light] {--scroll-thumb:#a8afb9;--scroll-thumb-hover:#7d8795;--scroll-thumb-active:#596475}

/* Shared native scrollbars: no replacement scrolling or focus interception. */
html:root, html:root :where(:not(.scrollbar-hide)) {
  scrollbar-width:thin;
  scrollbar-color:var(--scroll-thumb) transparent;
}
@supports selector(::-webkit-scrollbar) {
  html:root, html:root :where(:not(.scrollbar-hide)) {scrollbar-width:auto;scrollbar-color:auto}
  html:root::-webkit-scrollbar, html:root ::-webkit-scrollbar {width:10px;height:10px;background:transparent}
  html:root::-webkit-scrollbar-track, html:root ::-webkit-scrollbar-track, html:root::-webkit-scrollbar-corner, html:root ::-webkit-scrollbar-corner {background:transparent}
  html:root::-webkit-scrollbar-thumb, html:root ::-webkit-scrollbar-thumb {
    min-height:32px;min-width:32px;border:2px solid transparent;border-radius:999px;
    background:var(--scroll-thumb);background-clip:padding-box;
  }
  html:root::-webkit-scrollbar-thumb:hover, html:root ::-webkit-scrollbar-thumb:hover {background-color:var(--scroll-thumb-hover)}
  html:root::-webkit-scrollbar-thumb:active, html:root ::-webkit-scrollbar-thumb:active {background-color:var(--scroll-thumb-active)}
  html:root::-webkit-scrollbar-button, html:root ::-webkit-scrollbar-button {display:none;width:0;height:0}
}
@media (forced-colors:active) {
  html:root, html:root :where(:not(.scrollbar-hide)) {scrollbar-width:auto;scrollbar-color:auto}
}

/* Shared modal surfaces and comfortable content-to-scrollbar spacing. */
:root {--dialog-bg:#111418;--dialog-footer:#15191e;--dialog-control:#1b2027;--dialog-line:#2a3038;--dialog-backdrop:#05080dc9}
:root[data-admin-theme=light] {--dialog-bg:#fff;--dialog-footer:#f8fafc;--dialog-control:#f2f4f7;--dialog-line:#e4e7ec;--dialog-backdrop:#10182880}
:root body.admin :is(dialog,[role=dialog],.modal,.document-modal) {
 --panel:var(--dialog-bg);--card:var(--dialog-bg);--control:var(--dialog-control);--ui-control:var(--dialog-control);--border:var(--dialog-line);
 background:var(--dialog-bg);color:var(--text);border-color:var(--dialog-line);box-shadow:0 24px 80px #0006;
}
:root body.admin dialog::backdrop {background:var(--dialog-backdrop);backdrop-filter:blur(5px)}
:root body.admin :is(.modal-backdrop,.document-modal-backdrop,.member-modal-backdrop,.item-delete-backdrop) {background:var(--dialog-backdrop);backdrop-filter:blur(5px)}
:root body.admin :is(.entity-editor-heading,.member-dialog-header,.member-dialog-head,.store-dialog-head,.modal-header) {padding:24px;border-color:var(--dialog-line);background:var(--dialog-bg);gap:20px}
:root body.admin :is(.entity-dialog-scroll,.member-dialog-body,.store-dialog-body,.modal-body) {padding:24px;min-width:0;scrollbar-gutter:stable}
:root body.admin :is(.member-dialog-footer,.member-dialog-actions,.store-dialog-footer,.modal-footer,.document-modal-toolbar) {background:var(--dialog-footer);border-color:var(--dialog-line)}
:root body.admin :is(.member-dialog-footer,.member-dialog-actions,.store-dialog-footer,.modal-footer) {padding:16px 24px;gap:12px}
:root body.admin .entity-dialog .entity-form-actions {background:var(--dialog-footer);border-color:var(--dialog-line)}
:root body.admin .entity-dialog>.entity-form-actions {position:static;margin:0;padding:16px 24px;gap:12px;box-sizing:border-box}
:root body.admin :is(dialog,[role=dialog],.modal) :is(.people-filter-options,.person-firms-list,.company-choice-list,.selection-list,.grant-list,.access-detail-list) {padding-inline-end:12px;scrollbar-gutter:stable}
:root body.admin :is(dialog,[role=dialog],.modal) :is(h2,h3,p,label,.person-firm-name) {overflow-wrap:anywhere;min-width:0}
@media(max-width:600px) {
 :root body.admin :is(.entity-editor-heading,.member-dialog-header,.member-dialog-head,.store-dialog-head,.modal-header,.entity-dialog-scroll,.member-dialog-body,.store-dialog-body,.modal-body) {padding:20px}
 :root body.admin :is(.member-dialog-footer,.member-dialog-actions,.store-dialog-footer,.modal-footer) {padding:16px 20px}
 :root body.admin .entity-dialog>.entity-form-actions {padding:16px 20px}
}

/* Document reading and editing share clearly bounded, padded sections. */
body.admin .doklad-detail .detail-grid {align-items:start;gap:24px}
body.admin .doklad-detail :is(.preview.card,.detail-data>.card) {padding:20px;border:1px solid var(--border);border-radius:12px;background:var(--panel);min-width:0}
body.admin .doklad-detail .detail-data>.card {margin-bottom:16px}
body.admin .doklad-detail .detail-data>.card>h2 {margin:0 0 16px}
body.admin .doklad-detail .fields dl {column-gap:20px;row-gap:12px}
body.admin .doklad-detail .fields dd {min-width:0;overflow-wrap:anywhere}
body.admin .doklad-detail .preview>p.muted {margin:12px 0 0;font-size:12px;line-height:1.6}
body.admin .doklad-detail .preview-expand {right:20px;top:20px}
@media(max-width:600px) {
 body.admin .doklad-detail .detail-grid {gap:16px}
 body.admin .doklad-detail :is(.preview.card,.detail-data>.card) {padding:16px}
 body.admin .doklad-detail .preview-expand {right:16px;top:16px}
}

/* Company context selector: a quiet surface, not a bordered form field. */
body.admin .workspace-switcher>summary:hover,
body.admin .workspace-switcher[open]>summary {background:color-mix(in srgb,var(--text) 10%,var(--panel))}
body.admin .workspace-switcher>summary:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
@media(forced-colors:active) {body.admin .workspace-switcher>summary {border:1px solid ButtonText}}

body.admin .workspace-switcher-panel {padding-top:20px}
body.admin .workspace-switch-heading {margin-bottom:12px}
body.admin .workspace-switch-back {flex:0 0 auto;width:auto;min-height:40px;padding:8px 10px;gap:8px;font:inherit;font-size:13px;font-weight:500;color:var(--muted);background:transparent}
body.admin .workspace-switch-back:hover {color:var(--text);background:var(--hover)}
body.admin .workspace-switch-back svg {width:18px;height:18px;flex:none}

/* Keep each day together while separating consecutive daily ledgers. */
body.admin .doklady .day+.day {margin-top:52px}
body.admin .doklady .day-head {margin-bottom:14px}
@media(max-width:600px) {body.admin .doklady .day+.day {margin-top:40px}}

/* Round the painted cells themselves, without clipping menus or focus rings. */
body.admin .document-ledger {border-collapse:separate;border-spacing:0}
body.admin .document-ledger thead tr:first-child th:first-child {border-top-left-radius:calc(var(--radius) - 1px)}
body.admin .document-ledger thead tr:first-child th:last-child {border-top-right-radius:calc(var(--radius) - 1px)}
body.admin .document-ledger tbody tr:last-child td:first-child {border-bottom-left-radius:calc(var(--radius) - 1px)}
body.admin .document-ledger tbody tr:last-child td:last-child {border-bottom-right-radius:calc(var(--radius) - 1px)}

/* The document has a labeled close action, never the icon-only button sizing. */
:root body.admin .document-modal .document-modal-close {position:static;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:auto;height:40px;min-height:40px;padding:8px 12px;gap:8px;white-space:nowrap;border:0;border-radius:8px;font-size:13px;line-height:20px;background:var(--control);color:var(--text)}
:root body.admin .document-modal-toolbar {padding:12px 24px;min-height:64px}
:root body.admin .doklad-detail .document-fields-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 20px;padding:0;min-height:40px}
:root body.admin .doklad-detail .document-fields-heading h2 {margin:0!important;font-size:18px}
:root body.admin .doklad-detail .fields>dl {margin:0}
:root body.admin .doklad-detail .document-directory {margin:0 0 20px;border:0;border-radius:8px;background:var(--control)}
:root body.admin .doklad-detail .document-directory>summary {padding:10px 12px;gap:10px;min-height:44px}
:root body.admin .doklad-detail .document-directory .directory-identity {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
:root body.admin .doklad-detail .document-directory .directory-identity strong {font-size:13px;font-weight:500}
:root body.admin .doklad-detail .document-directory .directory-icon {width:16px;height:16px}
:root body.admin .doklad-detail .fields dl>.document-supplier-block {padding:0 0 16px;margin:0 0 4px;border:0;border-bottom:1px solid var(--border);border-radius:0;gap:6px}
:root body.admin .doklad-detail .document-supplier-block>dd {font-size:16px}
:root body.admin .doklad-detail .detail-data>.card:not(.confirm-form)>h3 {margin:0 0 12px}
@media(max-width:600px) {
 :root body.admin .document-modal-toolbar {padding:10px 16px}
 :root body.admin .doklad-detail .document-fields-heading {flex-wrap:wrap;margin-bottom:16px}
}

:root body.admin .doklad-detail .document-fields-heading>.detail-edit-action{margin:0}

:root body.admin .document-modal .document-modal-close{transition:background-color .15s,color .15s}
:root body.admin .document-modal .document-modal-close:hover{background:var(--ui-input-line);color:var(--text)}

/* Document detail and editor share aligned columns and a single action footer. */
:root body.admin .doklad-detail .items-view.document-items th:nth-child(2),
:root body.admin .doklad-detail .items-view.document-items th:nth-child(3) {text-align:right}
:root body.admin .doklad-detail .document-directory>summary {cursor:pointer;border-radius:8px;transition:background-color .15s}
:root body.admin .doklad-detail .document-directory>summary:hover {background:var(--hover)}
:root body.admin .doklad-detail .directory-change-label {cursor:inherit;white-space:nowrap;text-underline-offset:3px}
:root body.admin .doklad-detail .document-directory>summary:is(:hover,:focus-visible) .directory-change-label {text-decoration:underline}
:root body.admin .doklad-detail .document-directory>summary:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
:root body.admin .doklad-detail .confirm-form>.js-add-item {margin:8px 0 0}
:root body.admin .doklad-detail .confirm-form>.document-accounting {margin-bottom:0;border-bottom:0;padding-inline:0}
:root body.admin .doklad-detail .document-form-actions {display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:12px;margin-top:20px;padding-top:20px}
:root body.admin .doklad-detail .document-form-actions>.btn {width:auto;margin:0;min-height:44px}
@container documentdata (max-width: 519px) {
 :root body.admin .doklad-detail .document-form-actions {flex-direction:column-reverse;align-items:stretch}
 :root body.admin .doklad-detail .document-form-actions>.btn {width:100%;justify-content:center}
}

/* Delivery: queue first, settings in a separate, stable-width view. */
body.admin .delivery-page-tabs {display:flex;gap:28px;flex-wrap:wrap;border-bottom:1px solid var(--border);margin:0 0 24px}
body.admin .delivery-page-tabs a {padding:12px 0;color:var(--muted);font-weight:600;text-decoration:none;border-bottom:2px solid transparent}
body.admin .delivery-page-tabs a[aria-current] {color:var(--text);border-bottom-color:var(--accent)}
body.admin .delivery-page-tabs a:hover {color:var(--text)}
body.admin .delivery-queue-status {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px;font-size:13px;color:var(--muted)}
body.admin .delivery-queue-status>span {display:flex;align-items:center;gap:8px}
body.admin .delivery-settings-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;width:100%;align-items:start;margin:0 0 24px}
body.admin .delivery-settings-layout>.card {margin:0;min-width:0;padding:24px}
body.admin .delivery-company-form .form-grid {display:grid;gap:18px;margin:0}
body.admin .delivery-company-form .form-grid>p {margin:-8px 0 0;font-size:13px;line-height:1.6}
body.admin .delivery-company-form .form-grid>label:not(.checkbox) {display:grid;gap:8px;min-width:0}
body.admin .delivery-company-form input[type=email] {width:100%;min-width:0}
body.admin .delivery-form-actions {padding-top:18px;margin-top:2px;border-top:1px solid var(--border);display:flex;justify-content:flex-end}
body.admin .delivery-overview .delivery-route-summary {display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:24px 0 12px}
body.admin .delivery-route-summary dt {margin-bottom:6px}
body.admin .delivery-server-link {display:inline-flex;margin:0 0 24px}
body.admin .delivery-destinations-heading {display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 12px}
body.admin .delivery-destinations-heading h3 {font-size:14px;margin:0}
body.admin .delivery-destinations {max-height:320px;overflow:auto;scrollbar-gutter:stable;min-width:0}
body.admin .delivery-destinations table {width:100%;table-layout:fixed;border-collapse:collapse}
body.admin .delivery-destinations :is(th,td) {padding:12px 10px;text-align:left;overflow-wrap:anywhere;border-bottom:1px solid var(--border);font-size:13px}
body.admin .delivery-destinations thead th {color:var(--muted);font-weight:400;background:var(--panel);position:sticky;top:0}
body.admin .delivery-destinations tbody th {font-weight:500}
body.admin .delivery-destinations th:first-child {width:40%}
body.admin .delivery-saved-note {margin:16px 0 0;font-size:12px}
body.admin .delivery-supplier-settings {margin:24px 0;border:1px solid var(--border);border-radius:12px;overflow:hidden}
body.admin .delivery-supplier-settings>summary {padding:20px 24px;cursor:pointer;font-weight:600}
body.admin .delivery-supplier-body {padding:0 24px 24px}
body.admin .delivery-supplier-body>p {margin:0 0 12px;line-height:1.6;font-size:13px}
body.admin .delivery-supplier-body .form-grid {max-width:640px;gap:16px;margin:20px 0 0}
body.admin .delivery-supplier-body .form-grid>button {justify-self:start}
body.admin .delivery-supplier-body .form-grid>label {display:grid;gap:8px}
body.admin .delivery-page .delivery-tabs {margin-top:0}
@media(max-width:1150px){body.admin .delivery-settings-layout{grid-template-columns:1fr}}
@media(max-width:640px){body.admin .delivery-settings-layout>.card{padding:20px 16px}body.admin .delivery-page-tabs{gap:20px}body.admin .delivery-page-tabs a{font-size:13px}body.admin .delivery-supplier-settings>summary{padding:20px 16px}body.admin .delivery-supplier-body{padding:0 16px 20px}body.admin .delivery-form-actions .btn{width:100%}}

body.admin .export-delivery-link{margin:16px 0 20px}

/* Account entry: comfortable controls without changing scanner or other forms. */
/* Supplier workspace: navigation, filters and comparable amounts share one rhythm. */
body.admin .supplier-nav {display:flex;gap:8px;margin:0 0 24px;align-items:stretch}
body.admin .supplier-nav a {position:relative;gap:9px;min-height:48px;padding:12px 16px;border-bottom:3px solid transparent;font-size:14px;font-weight:500;line-height:20px}
body.admin .supplier-nav a .icon {width:17px;height:17px;flex:0 0 17px;color:var(--muted)}
body.admin .supplier-nav a[aria-current=page] {color:var(--text);font-weight:650;border-bottom-color:var(--accent);background:color-mix(in srgb,var(--accent) 7%,transparent)}
body.admin .supplier-nav a[aria-current=page] .icon {color:var(--accent)}
body.admin .supplier-nav a:hover {background:var(--control);color:var(--text)}
body.admin .supplier-overview .toolbar-filters {align-items:flex-end;gap:12px;padding:0 0 20px;margin-bottom:0}
body.admin .supplier-overview .ui-filter-field {flex:0 1 240px;min-width:180px;margin:0}
body.admin .supplier-overview .payment-search-group {display:flex;align-items:flex-end;gap:10px;max-width:620px;min-width:0;flex:1 1 340px;margin:0}
body.admin .supplier-overview .supplier-search-field {display:grid;gap:6px;flex:1;min-width:0;margin:0;font-size:12px;color:var(--muted)}
body.admin .supplier-overview .toolbar-filters :is(.lp-select-toggle,input[type=search],button[type=submit]) {height:44px;min-height:44px;box-sizing:border-box;margin:0;font-size:14px}
body.admin .supplier-overview .toolbar-filters.ui-filterbar .lp-select-toggle {height:44px;min-height:44px;padding:9px 12px;line-height:22px}
body.admin .supplier-overview .toolbar-filters .lp-select {width:100%;margin:0}
body.admin .supplier-overview .toolbar-filters input[type=search] {width:100%;padding:10px 12px}
body.admin .supplier-overview .payment-stats.supplier-period-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--border);background:var(--panel);margin:24px 0 28px;overflow:hidden}
body.admin .supplier-overview .supplier-period-stats>div {display:block;padding:16px 20px;border:0;border-right:1px solid var(--border)}
body.admin .supplier-overview .supplier-period-stats>div:last-child {border:0}
body.admin .supplier-overview .supplier-period-stats span {display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
body.admin .supplier-overview .supplier-period-stats span::before {content:"";width:7px;height:7px;border-radius:50%;background:var(--muted)}
body.admin .supplier-overview .supplier-total-paid span::before {background:var(--green)}
body.admin .supplier-overview .supplier-total-check span::before {background:#e5b85c}
body.admin .supplier-overview .supplier-period-stats strong {display:block;font-size:22px;font-weight:600;margin:6px 0 0;line-height:1.4;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body.admin .supplier-list-heading {display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin:0 0 12px}
body.admin .supplier-list-heading h2 {font-size:16px;margin:0}
body.admin .supplier-list-heading h2 span {margin-left:8px;font-size:13px;color:var(--muted);font-weight:400}
body.admin .supplier-list-heading p {font-size:12px;color:var(--muted);margin:0}
body.admin .supplier-payment-list {border:1px solid var(--border);border-radius:12px;background:var(--card);overflow:hidden}
body.admin :is(.supplier-column-head,.supplier-summary) {display:grid;grid-template-columns:minmax(180px,1fr) repeat(3,minmax(120px,.45fr)) 14px;gap:20px;align-items:center;padding:16px 20px}
body.admin .supplier-column-head {padding-block:12px;background:var(--panel);border-bottom:1px solid var(--border);font-size:12px;color:var(--muted)}
body.admin .supplier-column-head>span:not(:first-child) {text-align:right}
body.admin .supplier-summary {min-height:76px;cursor:pointer;transition:background-color .15s}
body.admin .supplier-summary:hover {background:var(--control)}
body.admin .supplier-payment-name {font-size:14px;line-height:21px}
body.admin .supplier-payment-count {font-size:12px}
body.admin .supplier-summary-amount>span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.admin .supplier-summary-amount strong {font-size:14px;line-height:22px;font-weight:600}
body.admin .supplier-summary-amount .is-zero {font-weight:400;color:var(--muted)}
body.admin .supplier-summary-check .has-value {color:#e5b85c}
:root[data-admin-theme=light] body.admin .supplier-summary-check .has-value {color:#8c5b0b}
body.admin .supplier-payment-group .supplier-payment-row {background:var(--panel);padding:14px 20px}
body.admin .supplier-directory .supplier-directory-search {display:block;max-width:none;margin:0 0 16px}
body.admin .supplier-directory-search>label {font-size:12px;margin:0 0 6px}
body.admin .supplier-directory-search>div {display:flex;gap:10px;align-items:center;flex-wrap:wrap}
body.admin .supplier-directory-search input[type=search] {flex:0 1 360px;width:100%;min-width:180px;height:44px;margin:0;font-size:14px}
body.admin .supplier-directory-search .btn {height:44px;min-height:44px}
body.admin .supplier-directory .supplier-create {padding:10px 16px;margin:0 0 20px;max-width:640px;background:var(--panel)}
body.admin .supplier-directory .supplier-unassigned {margin:0 0 12px;padding:0}
body.admin .supplier-result-count {font-size:12px;color:var(--muted);margin:20px 0 10px}
body.admin .supplier-directory-list {overflow:hidden}
body.admin :is(.supplier-directory-columns,.supplier-directory-entry) {display:grid;grid-template-columns:minmax(160px,1fr) 150px 100px 120px;gap:0 24px;align-items:center;padding:14px 20px}
body.admin .supplier-directory-columns {padding-block:12px;background:var(--panel);border-bottom:1px solid var(--border);font-size:12px;color:var(--muted)}
body.admin .supplier-directory-columns>span:nth-child(3) {text-align:right}
body.admin .supplier-directory-entry {min-height:68px}
body.admin .supplier-directory-identity {display:flex;gap:12px;align-items:center;min-width:0}
body.admin .supplier-directory-identity>.icon,body.admin .supplier-directory-identity>span {color:var(--muted);flex:0 0 20px}
body.admin .supplier-directory-entry h2 {padding:0;margin:0;font-size:14px;line-height:21px}
body.admin .supplier-directory-entry :is(.supplier-entry-ico,.supplier-entry-count) {margin:0;font-size:13px;font-variant-numeric:tabular-nums}
body.admin .supplier-entry-ico {color:var(--muted)}
body.admin .supplier-entry-count {text-align:right}
body.admin :is(.supplier-entry-ico,.supplier-entry-count)>span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.admin .supplier-directory-entry>details {grid-column:1/-1;padding:0}
body.admin .supplier-directory-entry>details>summary {top:12px;right:20px;min-height:44px;padding:10px 8px;border-radius:6px;font-size:13px;color:var(--text)}
body.admin .supplier-directory-entry>details>summary:hover {background:var(--control)}
body.admin .supplier-directory-entry>details[open] {margin-top:14px;padding:18px 0 4px;border-top:1px solid var(--border)}
body.admin .supplier-directory-entry>details form {display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
body.admin .supplier-directory-entry>details form label {flex:1 1 280px;max-width:520px;margin:0}
body.admin .supplier-directory-entry>details form input {height:44px;margin-bottom:0}
body.admin .supplier-directory-entry>details form .btn {height:44px;margin:0}
@container directory (max-width:850px) {
 body.admin :is(.supplier-column-head,.supplier-summary) {grid-template-columns:minmax(160px,1fr) repeat(3,minmax(100px,.45fr)) 12px;gap:12px;padding-inline:16px}
 body.admin :is(.supplier-directory-columns,.supplier-directory-entry) {grid-template-columns:minmax(160px,1fr) 100px 70px 110px;gap:0 16px;padding-inline:16px}
 body.admin .supplier-directory-entry>details>summary {right:16px}
}
@container directory (max-width:640px) {
 body.admin .supplier-nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 body.admin .supplier-nav a {display:flex;flex-direction:column;justify-content:center;gap:6px;text-align:center;padding:10px 4px;font-size:12px;line-height:17px;min-height:66px}
 body.admin .supplier-overview .ui-filter-field {flex-basis:100%;min-width:0}
 body.admin .supplier-overview .payment-search-group {flex-basis:100%;max-width:none}
 body.admin .supplier-overview .payment-caption {margin-left:0;font-size:11px}
 body.admin .supplier-overview .payment-stats.supplier-period-stats {grid-template-columns:1fr;margin:20px 0}
 body.admin .supplier-overview .supplier-period-stats>div {display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 12px;padding:12px 16px;border:0;border-bottom:1px solid var(--border)}
 body.admin .supplier-overview .supplier-period-stats strong {grid-column:2;font-size:18px;margin:0;text-align:right}
 body.admin .supplier-list-heading {display:block}
 body.admin .supplier-list-heading p {margin-top:4px}
 body.admin .supplier-column-head {display:none}
 body.admin .supplier-summary {grid-template-columns:repeat(3,minmax(0,1fr)) 12px;gap:12px 8px;padding:16px;min-height:0}
 body.admin .supplier-summary-identity {grid-column:1/4;grid-row:1}
 body.admin .supplier-summary .supplier-payment-chevron {grid-column:4;grid-row:1}
 body.admin .supplier-summary-amount {grid-column:auto;grid-row:2;text-align:left;display:block}
 body.admin .supplier-summary-amount>span {position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;font-size:11px;margin-bottom:4px}
 body.admin .supplier-summary-amount strong {font-size:12px;white-space:normal;overflow-wrap:anywhere;line-height:18px}
 body.admin .supplier-directory-columns {display:none}
 body.admin .supplier-directory-entry {grid-template-columns:1fr auto;gap:6px 12px;padding:16px}
 body.admin .supplier-directory-identity {grid-column:1/-1}
 body.admin .supplier-entry-ico {grid-column:1;padding-left:32px}
 body.admin .supplier-entry-count {grid-column:2;text-align:right}
 body.admin :is(.supplier-entry-ico,.supplier-entry-count)>span {position:static;width:auto;height:auto;overflow:visible;clip-path:none}
 body.admin .supplier-directory-entry>details {margin-top:6px}
 body.admin .supplier-directory-entry>details>summary {position:static;min-height:40px;display:list-item;width:fit-content;margin-left:24px}
 body.admin .supplier-directory-entry>details[open] {margin-top:6px;padding-top:6px;border:0}
 body.admin .supplier-directory-entry>details[open]>summary {margin-bottom:12px}
}
body.admin.page-admin-login main {max-width:520px;padding:32px 20px;box-sizing:border-box}
body.admin.page-admin-login .login-card {max-width:480px;padding:36px;border-radius:20px}
body.admin.page-admin-login .login-logo {width:190px;margin:0 0 32px}
body.admin.page-admin-login .login-heading h1 {font-size:28px;line-height:1.25;margin:0 0 8px}
body.admin.page-admin-login .login-heading .muted {font-size:14px;margin:0}
body.admin.page-admin-login .login-card form {display:grid;gap:20px;margin:28px 0 0}
body.admin.page-admin-login .login-card label {display:grid;gap:8px;margin:0;font-size:14px;font-weight:500;color:var(--text)}
body.admin.page-admin-login .login-card input:not([type=hidden]) {width:100%;height:52px;min-height:52px;padding:14px 16px;box-sizing:border-box;font-size:16px;line-height:22px;border-radius:10px}
body.admin.page-admin-login .login-password-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
body.admin.page-admin-login .login-password-heading a {font-size:13px;color:var(--muted);text-decoration:none}
body.admin.page-admin-login .login-card .btn-primary {height:52px;min-height:52px;margin:4px 0 0;font-size:15px;border-radius:10px}
body.admin.page-admin-login .login-register {display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin:24px 0 0;font-size:14px;color:var(--muted)}
body.admin.page-admin-login .login-register a {font-weight:600;color:var(--text);text-decoration:none}
body.admin.page-admin-login .login-card a:hover {color:var(--text);text-decoration:underline;text-underline-offset:4px}
body.admin.page-admin-login .login-help {margin-top:24px;padding-top:20px}
body.admin.page-admin-login .login-help summary {color:var(--muted)}
@media(max-width:520px){body.admin.page-admin-login main{padding:24px 16px}body.admin.page-admin-login .login-card{padding:28px 24px}body.admin.page-admin-login .login-heading h1{font-size:25px}}
@media(max-height:720px){body.admin.page-admin-login main{justify-content:flex-start}}

/* Secondary actions use charcoal; pending changes use a lighter charcoal. */
:root body.admin .btn.save-state-button,
:root body.admin form[method="get" i] :is(button.btn:not([type="button"]):not([type="reset"]),input.btn[type="submit"]) {
  color:var(--filter-text,var(--ui-text))!important;background:var(--filter-bg,var(--ui-hover))!important;border-color:transparent!important;filter:none;box-shadow:none;
}
:root body.admin .btn.save-state-button:hover,
:root body.admin form[method="get" i] :is(button.btn:not([type="button"]):not([type="reset"]),input.btn[type="submit"]):hover {
  background:var(--filter-hover,var(--ui-line))!important;border-color:transparent!important;
}
:root body.admin .btn.save-pending,
:root body.admin form[method="get" i] .btn.filter-pending {
  --filter-text:#fff;--filter-bg:#494e55;--filter-hover:#5b6169;
}
:root[data-admin-theme="light"] body.admin .btn.save-pending,
:root[data-admin-theme="light"] body.admin form[method="get" i] .btn.filter-pending {
  --filter-text:#fff;--filter-bg:#51565e;--filter-hover:#656b74;
}
:root body.admin form[method="get" i] .btn :is(svg,.icon) {color:inherit;stroke:currentColor}

/* Keep the wallet amount readable even in the compact navigation. */
body.admin .workspace-credit{position:relative}.workspace-credit-warning{display:grid;place-items:center;width:19px;height:19px;flex-shrink:0;background:#e4b341;color:#231c08;border-radius:50%;font-size:13px;line-height:1}.workspace-credit.is-low small{color:#e4b341}
@media(min-width:901px){:root[data-sidebar=collapsed] body.admin .workspace-sidebar .workspace-credit{display:flex;flex-direction:column;gap:7px;padding:12px 2px;width:100%;height:auto;min-height:74px;justify-content:center;align-items:center;overflow:visible}:root[data-sidebar=collapsed] body.admin .workspace-sidebar .workspace-credit>strong{position:static!important;clip:auto!important;clip-path:none!important;width:auto!important;height:auto!important;overflow:visible!important;margin:0!important;white-space:nowrap;font-size:11px;line-height:1.25;letter-spacing:-.025em}:root[data-sidebar=collapsed] body.admin .workspace-sidebar .workspace-credit-warning{position:absolute;top:5px;right:8px;width:15px;height:15px;font-size:11px}:root[data-sidebar=collapsed] body.admin .workspace-sidebar .workspace-credit>.workspace-credit-label{display:none}}
body.admin .workspace-logout .icon{width:20px;height:20px;flex:0 0 20px}

/* A quiet count of work waiting in the selected company, also visible when collapsed. */
body.admin .workspace-sidebar>nav>a {position:relative}
body.admin .workspace-sidebar>nav>a>.workspace-nav-count {
  flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;
  min-width:20px;height:20px;margin-left:auto;padding:0 5px;box-sizing:border-box;
  border:0;border-radius:7px;background:color-mix(in srgb,var(--text) 8%,var(--panel));
  color:var(--muted);font-size:11px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;
}
@media(min-width:901px) {
  :root[data-sidebar=collapsed] body.admin .workspace-sidebar>nav>a>.workspace-nav-count {
    position:absolute;right:0;top:0;min-width:17px;height:17px;padding:0 3px;font-size:10px;
  }
}

/* Shared account/access geometry, also inside dynamically mounted dialogs. */
:root body.admin :is(.member-dialog-close,.entity-dialog-close) {
 width:44px;height:44px;min-width:44px;min-height:44px;max-width:44px;max-height:44px;flex:0 0 44px;padding:0;border-radius:50%;
}
body.admin .entity-dialog-identities{margin-top:16px;gap:14px}
body.admin .entity-identity--person .entity-avatar{border-radius:50%;aspect-ratio:1}
body.admin :is(.entity-dialog,.member-dialog) .permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
body.admin :is(.entity-dialog,.member-dialog) .permission-options{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}
body.admin :is(.entity-dialog,.member-dialog) .permission-options label{min-height:40px;align-items:center;gap:10px}
body.admin :is(.entity-dialog,.member-dialog) .btn-danger{border-color:transparent;background:transparent;color:var(--danger,#e96b62);box-shadow:none;margin-right:auto}
body.admin :is(.entity-dialog,.member-dialog) .btn-danger:hover{background:var(--accent-soft,#ef574d18)}
body.admin .people-office-membership .person-company-summary{opacity:.75}
body.admin .people-office-membership .people-company-icon{background:var(--control);color:var(--muted)}
.workspace-signed-in{display:flex;align-items:center;gap:10px;padding:12px 10px 4px;min-width:0}
.workspace-signed-in>span:last-child{min-width:0}
.workspace-signed-in small{display:block;color:var(--muted);font-size:11px;margin-bottom:3px}
.workspace-signed-in strong{display:block;font-size:12px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-user-avatar{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:50%;background:var(--control);font-size:12px;color:var(--text)}
body.admin .supplier-directory .supplier-create{padding:0;max-width:580px}
@media(min-width:901px){:root[data-sidebar=collapsed] .workspace-signed-in{justify-content:center;padding-inline:0}:root[data-sidebar=collapsed] .workspace-signed-in>span:last-child{display:none}}
@media(max-width:600px){body.admin :is(.entity-dialog,.member-dialog) .permission-groups{grid-template-columns:minmax(0,1fr);gap:18px}}

/* Scan-only document rows keep the processing mode with the document identity. */
body.admin .ledger-mode {display:inline-block;color:var(--muted);font-size:12px;line-height:1.5;padding:3px 8px;border-radius:6px;background:var(--surface-2,var(--bg))}
@container ledger (max-width:760px){
 body.admin .document-ledger tr:has(.ledger-processing) {grid-template-columns:minmax(0,1fr)}
 body.admin .document-ledger tr:has(.ledger-processing) .ledger-document {grid-column:1;grid-row:1}
 body.admin .document-ledger .ledger-processing {grid-column:1;grid-row:2;text-align:left}
 body.admin .document-ledger tr:has(.ledger-processing) .ledger-stock {grid-column:1;grid-row:3;text-align:left}
}

/* Fold comparison and optional delivery-note fields. */


@media (min-width: 720px) and (max-width: 1100px) {
  :root body.admin .doklad-detail .detail-grid { grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); gap: .75rem; }
  :root body.admin .doklad-detail .preview { position: sticky; top: .5rem; padding: .75rem; min-width: 0; }
  :root body.admin .doklad-detail .preview > img { max-height: calc(100dvh - 210px); width: 100%; object-fit: contain; }
  :root body.admin .doklad-detail .preview iframe, :root body.admin .doklad-detail .preview-pages { height: auto; max-height: calc(100dvh - 210px); }
  :root body.admin .doklad-detail .preview iframe { height: calc(100dvh - 210px); }
  :root body.admin .doklad-detail .preview-pages img { width: 100%; max-height: none; }
  :root body.admin .doklad-detail .preview .scan-switch { margin-right: 44px; max-width: calc(100% - 44px); box-sizing: border-box; }
  :root body.admin .modal-body:has(.doklad-detail) { padding: .8rem; }
}
@container documentdata (max-width: 650px) {
  :root body.admin .doklad-detail .confirm-form { padding: 1rem; }
  :root body.admin .doklad-detail .items-edit.document-items, :root body.admin .doklad-detail .items-edit.document-items tbody { display: block; }
  :root body.admin .doklad-detail .items-edit.document-items thead { display: none; }
  :root body.admin .doklad-detail .items-edit.document-items tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; padding: .8rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
  :root body.admin .doklad-detail .items-edit.document-items tr td { display: block; width: auto; min-width: 0; padding: 0; border: 0; text-align: left; }
  :root body.admin .doklad-detail .items-edit.document-items tr td:first-child { grid-column: 1 / -1; grid-row: 1; }
  :root body.admin .doklad-detail .items-edit.document-items tr td:nth-child(2) { grid-column: 1; grid-row: 2; }
  :root body.admin .doklad-detail .items-edit.document-items tr td:nth-child(3) { grid-column: 2; grid-row: 2; }
  :root body.admin .doklad-detail .items-edit.document-items tr td:nth-child(4) { grid-column: 1; grid-row: 3; }
  :root body.admin .doklad-detail .items-edit.document-items tr td:nth-child(5) { grid-column: 2; grid-row: 3; justify-self: end; align-self: end; }
  :root body.admin .doklad-detail .items-edit.document-items td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; line-height: 1.4; color: var(--muted); margin-bottom: .4rem; }
  :root body.admin .doklad-detail .document-items input, :root body.admin .doklad-detail .document-items textarea { font-size: 16px; }
  :root body.admin .doklad-detail .document-items .remove-item { min-width: 44px; min-height: 44px; }
  :root body.admin .doklad-detail .confirm-form .totals-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  :root body.admin .doklad-detail .confirm-form .document-accounting { padding: 1rem 0; }
}
:root body.admin .doklad-detail .supporting-unpriced .document-money,
:root body.admin .doklad-detail .supporting-unpriced .document-items th:nth-child(2), :root body.admin .doklad-detail .supporting-unpriced .document-items th:nth-child(3), :root body.admin .doklad-detail .supporting-unpriced .document-items th:nth-child(4),
:root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tr td:nth-child(2), :root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tr td:nth-child(3), :root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tr td:nth-child(4) { display: none; }
:root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tr td:first-child { grid-column: 1; }
:root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tr td:last-child { grid-column: 2; grid-row: 1; }
:root body.admin .doklad-detail .supporting-unpriced .items-edit.document-items tbody tr { grid-template-columns: minmax(0, 1fr) 44px; }
:root body.admin .doklad-detail .supporting-unpriced .document-items th:first-child { width: auto; }

:root body.admin .doklad-detail .js-show-support-money { margin-bottom: 1rem; }

/* Photo modes stay together; fullscreen shares the separate tools row. */
:root body.admin .doklad-detail .preview:has(> .scan-toolbar:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:8px; }
:root body.admin .doklad-detail .preview > .scan-toolbar:not([hidden]) { display:contents; }
:root body.admin .doklad-detail .preview .scan-switch { grid-column:1 / -1; grid-row:1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.35fr); width:100%; max-width:none; margin:0; padding:4px; gap:4px; box-sizing:border-box; background:var(--control); border:1px solid var(--border); border-radius:10px; }
:root body.admin .doklad-detail .preview .scan-switch button { min-width:0; min-height:44px; padding:8px 6px; margin:0; white-space:normal; line-height:1.3; text-align:center; border-radius:6px; background:transparent; box-shadow:none; }
:root body.admin .doklad-detail .preview .scan-switch button[aria-pressed=true] { background:var(--panel); color:var(--text); box-shadow:0 1px 3px #0003; }
:root body.admin .doklad-detail .preview .scan-tools { grid-column:1; grid-row:2; min-width:0; }
:root body.admin .doklad-detail .preview .scan-status { grid-column:1 / -1; grid-row:3; margin:0 0 4px; }
:root body.admin .doklad-detail .preview:has(> .scan-toolbar:not([hidden])) > .preview-expand { position:static; grid-column:2; grid-row:2; align-self:start; justify-self:end; width:44px; height:44px; margin:0; }
:root body.admin .doklad-detail .preview > :is(img,.preview-pages,iframe,.page-thumbs,p) { grid-column:1 / -1; min-width:0; }
