@font-face { font-family: Montserrat; src: url('/zakazky/assets/regular.ttf'); font-weight: 400; font-display: swap; }
@font-face { font-family: Montserrat; src: url('/zakazky/assets/medium.ttf'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url('/zakazky/assets/bold.ttf'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: Accuratist; src: url('/zakazky/assets/accuratist.otf'); font-display: swap; }
:root {
  color-scheme: light dark;
  --paper: #fff; --ink: #1d1d1b; --muted: #62625d; --line: #dededa; --surface: #f6f6f3;
  --cyan: #009fe3; --magenta: #e6007e; --yellow: #ffed00; --error: #85223e;
  --gutter: clamp(20px,4.5vw,72px); --wrap: min(1280px,calc(100% - 2 * var(--gutter)));
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #232321; --ink: #f1eee8; --muted: #c3bfb6; --line: #494944; --surface: #2e2e2a; --error: #ffa1b8; }
  .powered img { filter: brightness(0) invert(1); }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 Montserrat,Arial,sans-serif; }
header { border-bottom: 1px solid var(--line); }
header > div, body > main { width: var(--wrap); max-width: none; margin-inline: auto; padding-inline: 0; }
header > div { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 15px; }
header picture, header img { display: block; }
header img { width: clamp(165px,17vw,238px); height: auto; margin: 0; }
header .brand { flex: none; }
header nav { gap: 4px; }
nav a { font: 500 .9rem/1.5 Montserrat,Arial,sans-serif; color: var(--ink); padding: 8px 12px; }
nav a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -2px var(--magenta); border-radius: 2px; }
nav form { margin: 0 0 0 8px; }
body > main { flex: 1; padding-block: clamp(22px,3vw,44px) 54px; }
h1,h2,h3 { color: var(--ink); font-weight: 500; line-height: 1.13; }
h1 { letter-spacing: -.06em; font-size: clamp(2.4rem,4.4vw,4.4rem); }
h2 { letter-spacing: -.04em; }
a,.back,.empty a { color: var(--ink); text-underline-offset: .19em; }
a:hover { text-decoration: underline; text-decoration-color: var(--magenta); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
button,.button { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 2px; padding: 9px 14px; font: 500 .9rem/1.45 Montserrat,Arial,sans-serif; cursor: pointer; }
button:hover,.button:hover { border-color: var(--ink); }
.primary,.customer-form button { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.primary:hover,.customer-form button:hover { background: color-mix(in srgb,var(--ink) 88%,var(--paper)); }
input:not([type=color]),select,textarea,.filters input,.filters select,.trend select,.journal textarea,.form input:not([type=checkbox]),.form select,.edit input[type=text],.add input[type=text] {
  border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font: inherit; padding: 8px 10px;
}
.sync-notice,.sync-note,.muted,.card small,.card time,.empty,.filters label,.note-inputs label { color: var(--muted); }
.sync-notice { font-size: .8rem; margin: 0 0 1.25rem; }
.lane,.filters.search,.jobs th,.directory th,.count { background: var(--surface); }
.lane,.card,.filters.search,.trend,.metrics div { border-radius: 2px; }
.card,.trend { color: var(--ink); background: var(--paper); border-color: var(--line); }
.tag { background: color-mix(in srgb,var(--color) 18%,var(--paper)); }
.metrics { grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 0; border: 1px solid var(--line); }
.metrics div { padding: 20px 24px; background: var(--surface); border: 0; border-inline-start: 3px solid var(--ink); }
.metrics div:nth-child(2) { border-color: var(--magenta); }
.metrics div:nth-child(3) { border-color: var(--cyan); }
.metrics div:nth-child(4) { border-color: var(--yellow); }
.metrics small { color: var(--muted); }
.metrics strong { color: var(--ink); font-size: clamp(1.5rem,2.4vw,2.2rem); font-weight: 500; }
.trend { padding: clamp(16px,2.4vw,30px); }
.jobs tbody tr:hover { background: var(--surface); }
.jobs td,.jobs th,.billing-lines td,.billing-lines th,.setting,.offer,.offer-row,.form fieldset,.invoice-panel,.journal,.note,.card time { border-color: var(--line); }
.danger,[role=alert],.late { color: var(--error) !important; }
.directory nav { margin: 1rem 0; }
.directory section { overflow-x: auto; }
.directory table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.directory th,.directory td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.directory footer { margin-top: 20px; }
.customer-form { max-width: 780px; }
.customer-form section { padding: 22px 0; border-top: 1px solid var(--line); }
.customer-form h1 { margin-bottom: 24px; }
.customer-form label { display: block; margin: 12px 0; }
.customer-form input:not([type=radio]) { display: block; width: min(100%,28rem); }
.customer-form dd { overflow-wrap: anywhere; }
footer.powered { margin-top: auto; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 18px max(var(--gutter),calc((100% - 1280px)/2)); border-top: 1px solid var(--line); color: var(--muted); font: 17px/1 Accuratist,sans-serif; }
.powered img { display: block; width: 88px; height: auto; }
/* Center the form within the space between the brand header and signature. */
body.login { background: var(--surface); }
.login header,.login footer { background: var(--paper); }
body > .login-main { position: relative; isolation: isolate; overflow: hidden; width: 100%; display: grid; place-items: center; padding: clamp(26px,6vh,80px) 18px; }
.login-main::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 25% 72%,color-mix(in srgb,var(--cyan) 6%,transparent),transparent 55%),radial-gradient(ellipse at 70% 20%,color-mix(in srgb,var(--magenta) 4%,transparent),transparent 50%); }
.login-trace { position: absolute; right: 0; top: 50%; width: min(48%,580px); height: auto; transform: translateY(-50%); pointer-events: none; z-index: -1; }
.login-trace path { stroke-dasharray: 1 1; }
.login-content { width: min(100%,440px); padding: clamp(26px,4vw,44px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 18px 65px -34px #19192355; }
.login h1 { margin: 0 0 7px; font-size: clamp(3rem,5vw,4.1rem); letter-spacing: -.065em; line-height: 1.08; }
.login-dot { display: inline-block; width: .115em; height: .115em; margin-left: .028em; background: #ec008b; border-radius: 50%; }
.login form { display: grid; gap: 7px; }
.login h2 { margin: 0 0 18px; color: var(--muted); font-size: 1.07rem; letter-spacing: -.02em; line-height: 1.5; }
.login label { font-size: .88rem; font-weight: 500; }
.login input { width: 100%; height: 48px; margin-bottom: 9px; border-radius: 7px; background: var(--surface); }
.login input:focus-visible { outline-color: var(--cyan); }
.login button { min-height: 48px; margin-top: 10px; border-radius: 7px; }
.login [role=alert] { margin: 0; }
@media(max-width:600px) {
  .login-content { width: min(100%,370px); }
  .login-trace { right: -36px; top: 0; transform: none; width: 66%; }
}
@media (max-width: 720px) {
  header > div { min-height: 65px; flex-wrap: wrap; gap: 6px; }
  header nav { width: 100%; }
  nav a { padding: 8px; }
  nav form { margin-inline-start: 0; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics div { padding: 12px; }
  .metrics strong { font-size: clamp(1.04rem,3.6vw,1.5rem); }
  .filters { max-width: 100%; flex-wrap: wrap; }
  .trend { padding: 12px; }
}

/* Carry the login's paper, fine CMYK arcs and rounded surfaces into the workspace. */
body:not(.login) {
  background: radial-gradient(ellipse at 92% 4%,color-mix(in srgb,var(--cyan) 6%,transparent),transparent 33rem),var(--surface);
}
body:not(.login) > header, body:not(.login) footer.powered { background:var(--paper); }
body:not(.login) header nav { align-items:center; }
body:not(.login) nav a, body:not(.login) button, body:not(.login) .button { border-radius:9px; }
body:not(.login) nav a[aria-current] { box-shadow:none; background:var(--ink); color:var(--paper); }
body:not(.login) main { min-width:0; }
.heading { position:relative; isolation:isolate; overflow:hidden; padding:clamp(20px,3vw,38px); border-radius:18px;
  background:var(--paper); border:1px solid var(--line); }
.heading h1::after { content:""; display:inline-block; margin-left:.045em; height:.115em; width:.115em; border-radius:50%; background:var(--magenta); }
.heading .button { position:relative; }
.panel,.invoice-panel,.trend,.search.filters,.table-scroll,.directory section,.settings section {
  border:1px solid var(--line); border-radius:18px; background:var(--paper);
  padding:clamp(16px,2.4vw,30px); box-shadow:0 14px 42px -36px #19192355; }
.panel,.invoice-panel,.journal { margin-block:16px; }
.panel .heading { padding:0; border:0; background:transparent; }
.panel .back { display:inline-block; margin-bottom:.8rem; }
.jobmeta { letter-spacing:.085em; font-weight:600; font-size:.77rem; }
.account-state { width:fit-content; padding:6px 12px; margin-top:12px; border-radius:20px; background:var(--surface); }
.filters.search { align-items:end; gap:14px; }
body:not(.login) :is(.form,.filters,.edit,.add,.journal,.customer-form,.trend) :is(input:not([type=color],[type=checkbox],[type=radio]),select,textarea) {
  border-radius:8px; background:var(--surface); }
.lane { border-radius:16px; border:1px solid var(--line); padding:14px; background:color-mix(in srgb,var(--paper) 60%,var(--surface)); }
.board { align-items:start; }
.card { border-radius:12px; padding:16px; box-shadow:0 5px 15px -13px #19192355; }
.card:hover,.card:focus-visible { border-color:var(--cyan); text-decoration:none; }
.count { background:var(--paper); }
.metrics { gap:12px; border:0; }
.metrics div { background:var(--paper); border-radius:13px; box-shadow:0 8px 26px -22px #19192355; }
.table-scroll { padding:0; overflow:auto; }
.note { border-inline-start:3px solid var(--cyan); padding:12px 16px; border-radius:7px; background:var(--surface); }
.file-link { display:inline-block; max-width:100%; overflow-wrap:anywhere; padding:5px 10px; border:1px solid var(--line); border-radius:7px; }
.note-inputs { align-items:start; }
@media(max-width:720px) {
  .heading { gap:12px; }
  .filters.search { align-items:stretch; }
  .metrics { gap:8px; }
  .journal input,.journal textarea { max-width:100%; min-width:0; }
}

.job-detail > main { width:calc(100% - 2 * var(--gutter)); }
.job-detail :is(.panel,.journal,.invoice-panel) { width:100%; max-width:none; }
header nav svg,.sort-mobile { display:none; }
body:not(.login) header nav { margin-left:auto; }
header .user-actions { display:flex; gap:6px; align-items:center; }
.user-actions form { margin:0; }
[hidden] { display:none !important; }
.directory-filters,.sort-mobile { padding:12px 16px; border-radius:12px; background:var(--paper); margin-block:10px; }
.directory-filters summary,.paid-lane summary { cursor:pointer; font-weight:600; }
.directory-filters form { display:flex; flex-wrap:wrap; align-items:end; margin-top:12px; }
.directory-filters label,.sort-mobile label { display:grid; gap:4px; }
.paid-lane summary { list-style:none; margin:0; min-height:30px; }
.paid-lane summary::-webkit-details-marker { display:none; }
.paid-lane summary::after { content:""; width:.48rem; height:.48rem; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg); margin:0 .25rem .24rem; }
.paid-lane[open] summary::after { transform:rotate(225deg); margin-bottom:0; }
#trend { cursor:pointer; }
@media(max-width:720px) {
  body:not(.login) { padding-bottom:calc(66px + env(safe-area-inset-bottom)); }
  body:not(.login) header > div { flex-wrap:nowrap; justify-content:space-between; padding-top:max(10px,env(safe-area-inset-top)); }
  body:not(.login) header img { width:128px; }
  body:not(.login) header nav { position:fixed; inset:auto 0 0; z-index:15; display:grid; width:100%; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr);
    gap:4px; padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    background:var(--paper); border-top:1px solid var(--line); box-shadow:0 -3px 18px #17171b0c; }
  body:not(.login) header nav a { display:grid; place-items:center; align-content:center; gap:2px; min-height:50px; padding:4px; font-size:.7rem; }
  header nav svg { display:block; width:21px; height:21px; }
  .user-actions button { font-size:.8rem; padding:6px 9px; }
  .job-detail { --gutter:12px; }
  .job-detail .panel,.job-detail .invoice-panel,.job-detail .journal { padding:16px; }
  .directory-filters form,.sort-mobile { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .directory-filters input,.sort-mobile select { width:100%; min-width:0; }
  .directory section { background:none; border:0; padding:0; box-shadow:none; }
  .directory table,.directory tbody,.directory tr { display:block; }
  .directory thead { display:none; }
  .directory tbody tr { border:1px solid var(--line); border-radius:14px; background:var(--paper); padding:10px 14px; margin-bottom:9px; }
  .directory td { display:grid; grid-template-columns:5rem minmax(0,1fr); gap:8px; overflow-wrap:anywhere; padding:5px 0; border:none; }
  .directory td::before { content:attr(data-label); color:var(--muted); }
  .directory td:first-child { display:block; font-weight:600; font-size:1rem; margin-bottom:4px; }
  .directory td:first-child::before { display:none; }
  .directory-filters input,.form input,.form textarea,.form select { font-size:16px; }
}

[data-level] { --state-color:#858585; }
[data-level="ok"] { --state-color:#148052; }
[data-level="busy"] { --state-color:#008dc4; }
[data-level="warn"] { --state-color:#c76110; }
.state-dot { display:inline-block; width:.62em; height:.62em; border-radius:50%; background:var(--state-color); vertical-align:.06em; margin-right:.28em; }
[data-clock] { font-variant-numeric:tabular-nums; white-space:nowrap; }
.health { margin:0; }
.health main { padding-block:clamp(24px,5vw,60px); }
.health h1 { margin:0 0 1.3rem; }
.health-agent,.health-grid article { background:var(--paper); border:1px solid var(--line); border-radius:15px; padding:clamp(16px,2vw,26px); }
.health-agent { border-inline-start:4px solid var(--cyan); }
.health-agent [data-agent] { font-size:clamp(1.05rem,2vw,1.4rem); }
.health-agent p,.health-grid p { margin:.6em 0 0; color:var(--muted); }
.health-actions { margin-top:1rem; }
.health-actions form { margin:0; }
.health-actions .button { display:inline-block; text-decoration:none; }
.health-actions button:disabled { opacity:.65; cursor:default; }
.health-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr)); gap:12px; margin-top:18px; }
.health-grid h2 { font-size:1.05rem; margin:0; }
.metric-label { display:none; }
@media(max-width:720px) {
  body.health { padding-bottom:0; }
  .period-list.table-scroll { border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible; }
  .period-list .billing-lines { display:block; min-width:0; width:100%; margin:0; }
  .period-list thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .period-list tbody { display:grid; gap:12px; }
  .period-list tbody tr { min-width:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px;
     padding:12px 16px; border:1px solid var(--line); border-radius:14px; background:var(--paper); }
  .period-list tbody th { grid-column:1/-1; padding:0 0 6px; border:0; text-align:start; }
  .period-list tbody th a { display:block; padding:5px 0; font-size:1.05rem; }
  .period-list tbody td { display:flex; flex-direction:column; justify-content:space-between; padding:7px 0 2px; text-align:start; border:0; border-top:1px solid var(--line); }
  .period-list .metric-label { display:block; color:var(--muted); font-size:.75rem; }
  .period-list td a { display:block; padding:.25em 0; overflow-wrap:anywhere; font-weight:600; font-variant-numeric:tabular-nums; }
}

.file-dialog { padding:0; border:1px solid var(--line); border-radius:18px; width:min(1120px,94vw); max-width:none; height:90dvh; max-height:none; background:var(--paper); color:var(--ink); overflow:hidden; }
.file-dialog::backdrop { background:rgb(15 18 21 / .62); }
body:has(.file-dialog[open]) { overflow:hidden; }
.file-dialog iframe { display:block; border:0; height:100%; width:100%; }
.file-dialog .preview-close { position:absolute; z-index:1; top:max(10px,env(safe-area-inset-top)); left:max(16px,env(safe-area-inset-left)); border-radius:8px; min-height:44px; background:var(--paper); }
body.file-view { padding:0; min-height:100dvh; }
.file-view header { position:sticky; top:0; z-index:1; background:var(--paper); }
.file-view header > div { width:100%; min-height:64px; padding:10px 16px; }
.file-view.embedded [data-close-preview] { visibility:hidden; }
.file-view header .button { border-radius:8px; text-decoration:none; text-align:center; }
.file-view main { width:min(100% - 32px,1080px); padding:20px 0 max(20px,env(safe-area-inset-bottom)); }
.file-view h1 { font-size:clamp(1.25rem,3vw,2rem); letter-spacing:-.035em; overflow-wrap:anywhere; }
.file-size { color:var(--muted); margin:.25rem 0 1rem; }
.file-image,.file-view video,.file-view audio { display:block; max-width:100%; margin-inline:auto; }
.file-image,.file-view video { max-height:75dvh; object-fit:contain; }
.file-view pre { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; font:1rem/1.55 ui-monospace,monospace; background:var(--surface); border-radius:9px; padding:1rem; }
.pdf-controls { display:flex; justify-content:center; align-items:center; gap:.7rem; margin-bottom:12px; }
.pdf-controls button { min-height:44px; border-radius:8px; }
.pdf-controls button:disabled { opacity:.45; }
.pdf-view canvas { display:block; width:100%; height:auto; background:#fff; box-shadow:0 1px 5px #0002; }
.pdf-view + a { display:inline-block; margin-top:12px; }
.price-history { padding-left:1.4rem; }
.price-history li { margin-block:1rem; overflow-wrap:anywhere; }
.price-lines { overflow:auto; }
.price-lines table { width:100%; border-collapse:collapse; }
.price-lines th,.price-lines td { padding:.45rem; border-bottom:1px solid var(--line); text-align:start; }
@media(max-width:720px) {
  .file-dialog { width:100%; height:100dvh; margin:0; border:0; border-radius:0; }
  .file-view header > div { padding-top:max(10px,env(safe-area-inset-top)); gap:4px; }
  .file-view main { width:calc(100% - 24px); }
  .file-view .button,.file-dialog .preview-close { font-size:.85rem; }
  .pdf-controls { justify-content:space-between; }
}
.shop-work,.shop-settings{--shop-line:var(--line,#d9d9d4);--shop-surface:var(--surface,#f6f6f3);color:inherit;min-width:0}
.shop-work *,.shop-settings *{box-sizing:border-box}
.shop-work .heading,.shop-tools,.shop-work .actions{display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap}
.shop-tools{justify-content:flex-start}.shop-work .heading{margin:1rem 0 1.5rem}
.shop-tools .button,.shop-tools button,.shop-agent summary{display:inline-flex;align-items:center;gap:.55rem;font:inherit}
.shop-tools svg,.shop-agent svg,.app-tools svg{width:1.15rem;height:1.15rem;flex:none}
.shop-tools b{font-size:.8rem;background:var(--shop-surface);border:1px solid var(--shop-line);padding:0 .45rem;border-radius:20px}
.shop-work .jobmeta,.shop-summary small,.shop-message small{display:block;color:var(--muted,#666);font-size:.8rem;margin-bottom:.35rem}
.shop-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-block:1px solid var(--shop-line);padding:1.15rem 0;gap:1rem}
.shop-summary strong{font-weight:600}.shop-card-body{display:grid;grid-template-columns:minmax(180px,1fr) minmax(0,2.4fr);gap:clamp(1.5rem,5vw,5rem);margin-top:2rem}
.shop-side,.shop-main,.shop-settings section{min-width:0;overflow-wrap:anywhere}
.shop-side p,.shop-main p,.shop-settings p{margin:.5rem 0}.shop-side h2:not(:first-child){margin-top:1.7rem}
.shop-main section,.shop-agent{padding-bottom:1.5rem;margin-bottom:1.5rem;border-bottom:1px solid var(--shop-line)}
.shop-message{padding:1rem 0;border-bottom:1px solid var(--shop-line);overflow-wrap:anywhere}
.shop-message:last-child{border-bottom:0}.shop-message strong{display:block}
.shop-message p{white-space:pre-wrap;max-width:80ch;font-size:.94rem}
.shop-form,.shop-settings form{display:grid;gap:.6rem;justify-items:start;margin:.9rem 0}
.shop-form label,.shop-settings form label{display:grid;gap:.3rem;width:100%;font-size:.9rem}
.shop-form textarea,.shop-settings :is(textarea,input,select),.shop-form select{font:inherit;color:inherit;background:var(--paper,#fff);border:1px solid var(--shop-line);padding:.65rem;width:100%;border-radius:3px}
.shop-form textarea{resize:vertical;min-height:4rem}.shop-form{width:100%}.shop-work .actions{justify-content:flex-start}
.shop-agent summary{cursor:pointer;font-weight:600;padding:.5rem 0}.shop-agent .actions form{width:auto}
.shop-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.25rem}
.shop-settings section{border:1px solid var(--shop-line);padding:clamp(1rem,2.1vw,1.8rem);border-radius:4px}
.shop-settings pre,.shop-settings code{white-space:normal;overflow-wrap:anywhere}
.shop-setting-links{grid-column:1/-1}.shop-setting-links .card{display:inline-grid;min-width:min(100%,240px);margin-right:.6rem}
.shop-work .switch [aria-current=page]{box-shadow:inset 0 -2px var(--magenta,#e6007e)}.shop-work .payment-status{font-size:.8rem}
.shop-work button:disabled,.app-tools button:disabled{opacity:.5;cursor:default}
@media(max-width:760px){.shop-card-body,.shop-settings{grid-template-columns:1fr}.shop-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.shop-work .heading{align-items:flex-start}.shop-tools .button,.shop-tools button{min-height:44px}}
.shop-service-state>a{display:inline-flex;gap:.45rem;align-items:center;flex-wrap:wrap}
.shop-service-state [data-ai]{border:1px solid var(--line);border-radius:3px;padding:.2rem .55rem}
.app-tools{display:inline-flex;align-items:center;gap:.35rem}.app-tools>a,.app-tools>button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:.35rem .5rem;gap:.2rem}
