* {box-sizing:border-box}
:root {font-family:system-ui,sans-serif;color:var(--ink);background:var(--background);line-height:1.5}
body {margin:0} [hidden]{display:none!important}
.shell {width:min(1140px,calc(100% - 40px));margin:auto}
.top {background:var(--background);border-bottom:1px solid var(--line)}
.brand {min-height:72px;display:flex;align-items:center;gap:12px}
.logo {display:block;width:clamp(108px,16vw,146px);height:auto}
.product {border-left:1px solid var(--line);padding-left:12px;color:var(--muted);letter-spacing:.08em}
.demo {margin-left:auto;font-size:.875rem;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:4px 10px}
.headline,.backup {display:flex;align-items:center;justify-content:space-between;gap:16px}
.headline {padding:36px 0 24px}
h1,h2,p {margin:0}
h1 {font-size:clamp(1.85rem,4vw,2.7rem);line-height:1.12;letter-spacing:-.035em}
h2 {font-size:1.16rem}
p {color:var(--muted);margin-top:7px}
button,input,select,textarea {font:inherit}
button {cursor:pointer;border:1px solid var(--muted);border-radius:8px;background:var(--paper);color:var(--ink);padding:9px 14px;font-weight:650;min-height:44px}
button:hover {background:var(--surface)}
.primary {background:var(--ink);border-color:var(--ink);color:var(--paper)}
.primary:hover {background:var(--accent);border-color:var(--accent)}
:focus-visible {outline:3px solid var(--accent);outline-offset:2px}
.stats {display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px}
.stat,.panel,.backup {background:var(--paper);border:1px solid var(--line);border-radius:12px}
.stat {padding:13px 17px;border-top:3px solid var(--accent-light)}
.stat span {display:block;color:var(--muted);font-size:.9rem}
.stat strong {font-size:1.8rem}
.tabs {display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.tabs [aria-pressed=true] {background:var(--ink);border-color:var(--ink);color:var(--paper)}
.filters,.object,.columns {display:grid;gap:14px;align-items:center;padding:14px 18px}
.filters {grid-template-columns:2fr 1fr 1fr}
label {display:grid;gap:5px;font-size:.9rem;font-weight:650;min-width:0}
input,select,textarea {width:100%;min-width:0;border:1px solid var(--muted);border-radius:7px;padding:8px 10px;color:var(--ink);background:var(--paper)}
input,select {min-height:42px}
input::placeholder,textarea::placeholder {color:var(--muted);opacity:1}
a {color:var(--accent)}
.object,.columns {grid-template-columns:minmax(0,2fr) minmax(0,1.15fr) minmax(0,1.15fr) minmax(0,1fr) minmax(0,.75fr) auto}
.columns {background:var(--surface);color:var(--ink);font-size:.875rem;font-weight:700}
.object {border-top:1px solid var(--line);overflow-wrap:anywhere}
.object strong,.object small {display:block}
small {font-size:.875rem;color:var(--muted)}
.tag {display:inline-block;border-radius:20px;padding:4px 9px;background:var(--surface);font-size:.875rem;font-weight:650}
.tag[data-status="Vykdomas"] {background:var(--accent);color:var(--paper)}
.tag[data-status="Sustabdytas"] {background:var(--background);color:var(--accent);outline:1px dashed currentColor;outline-offset:-1px}
.tag[data-status="Baigtas"] {background:var(--ink);color:var(--paper)}
.overdue {color:var(--accent);font-weight:700;text-decoration:underline dotted;text-underline-offset:3px}
progress {display:block;width:100%;max-width:120px;accent-color:var(--accent)}
.backup {margin:18px 0 32px;padding:16px 18px}
.actions {display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.history,.empty {padding:18px}
.event {padding:10px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.event ul {padding-left:22px;margin:6px 0}
#notice,#form-error {margin:8px 0;color:var(--accent)}
dialog {width:min(650px,calc(100% - 24px));max-height:90dvh;border:1px solid var(--line);border-radius:14px;padding:20px;color:var(--ink);background:var(--paper)}
dialog::backdrop {background:var(--ink);opacity:.62}
.dialog-head {display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.fields {display:grid;grid-template-columns:1fr 1fr;gap:10px 14px}
.wide {grid-column:1/-1}
dialog .actions {margin-top:14px}
#editor {width:min(760px,calc(100% - 24px));overflow-wrap:anywhere}
#editor .dialog-head {align-items:flex-start;gap:12px}
#object-context {font-size:.85rem;margin:0 0 4px}
#editor-title {font-size:clamp(1.3rem,3vw,1.7rem);line-height:1.2}
#object-card-status:empty {display:none}
#card-bill,#card-payment {width:min(520px,calc(100% - 24px));overflow-wrap:anywhere}
#card-bill .fields,#card-payment .fields {margin-top:14px}
#card-payment details {margin-top:12px}
#card-payment-error:not(:empty) {color:var(--accent)}
#card-bill-net,#card-bill-total {font-weight:650;color:var(--ink)}
#card-bill-error:not(:empty) {color:var(--accent)}
.card-bill-start {margin:5px 0}
#object-card-content > section {border-top:1px solid var(--line);padding:14px 0}
#object-card-content h3 {margin:0 0 6px;font-size:1.05rem}
#card-totals {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8.6rem),1fr));gap:4px 18px;margin:6px 0 12px}
#card-totals details {min-width:0}
#card-totals summary {color:var(--ink);font-size:.92rem}
#card-totals strong {display:block;font-size:1.2rem}
#card-totals small {display:block;font-weight:400;color:var(--muted)}
#card-totals .card-link {display:block;text-align:left}
#card-totals p {margin:0 0 8px}
#card-comparison {margin:0 0 12px}
#card-comparison .fields {margin:10px 0}
#card-comparison-help {font-size:.9rem;color:var(--muted)}
#card-comparison-status:empty {display:none}
.card-record {padding:8px 0}
.card-record + .card-record {border-top:1px solid var(--line)}
.card-record-head {display:flex;justify-content:space-between;align-items:baseline;gap:14px}
.card-record-head span {flex-shrink:0;font-weight:650}
.card-record small,.card-state {display:block}
.card-state,.card-link,.card-record summary,.card-more > summary {font-size:.9rem}
.card-link {min-height:36px;padding:4px 0;border:0;color:var(--accent);text-decoration:underline;background:transparent}
#editor summary {cursor:pointer;padding:8px 0;font-weight:650}
.card-record details p {margin:3px 0}
#object-tools,#object-fields:has(>summary:not([hidden])) {border-top:1px solid var(--line);padding:3px 0}
#object-tools .actions {justify-content:flex-start;margin:4px 0 8px}
@media(min-width:780px) {
  #editor:has(#object-card:not([hidden])) {width:min(920px,calc(100% - 40px))}
  #object-card-content {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:30px}
  #card-totals,#object-card-content > section:first-of-type {grid-column:1/-1}
}
@media(max-width:790px) {
.columns {display:none}
.object {grid-template-columns:repeat(2,minmax(0,1fr))}
.object-info {grid-column:1/-1}
.object button {justify-self:start}
.object [data-label]::before {content:attr(data-label);display:block;font-size:.875rem;color:var(--muted);margin-bottom:3px}
}
@media(max-width:550px) {
.shell {width:calc(100% - 24px)}
.headline,.backup {align-items:flex-start;flex-direction:column}
.headline {padding-top:24px}
.stats,.filters {grid-template-columns:repeat(2,minmax(0,1fr))}
.filters label:first-child {grid-column:1/-1}
.fields {grid-template-columns:1fr}
.backup .actions {justify-content:flex-start}
}

.login {max-width:470px;padding:clamp(30px,10vh,100px) 0}
.login form {padding:26px;display:grid;gap:16px}
.login h1 {font-size:clamp(1.55rem,5vw,2rem);margin-bottom:5px}
.login button {justify-self:start}
.session {display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:wrap;padding-top:12px}
.session details {margin-right:auto;color:var(--ink)}
.session summary {cursor:pointer;padding:10px 0;font-weight:650}
.row-actions {display:flex;flex-wrap:wrap;gap:6px}
.columns,.object {grid-template-columns:minmax(0,2fr) minmax(0,1.15fr) minmax(0,1.15fr) minmax(0,1fr) minmax(0,.75fr) minmax(0,165px)}
.history {margin-bottom:24px}
#workspace {padding-bottom:30px}
#acts {margin-top:12px}
#acts h2 {margin:18px 0 6px}
#act-project {max-width:42rem}
#project-totals {grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:700px) {
  #project-totals {grid-template-columns:repeat(2,minmax(0,1fr))}
  #project-totals .stat {padding:10px}
  #project-totals .stat strong {font-size:1.25rem}
}
#act-quantities {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px}
.act-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
#act-preview {width:min(900px,calc(100% - 24px))}
#act-sheet {color:var(--ink);padding:18px 8px}
.act-document-head,.act-total {display:flex;align-items:center;justify-content:space-between;gap:10px}
.act-document-head {border-bottom:2px solid var(--accent);padding-bottom:12px}
.act-document-head span,.act-meta dt,.act-byline {color:var(--muted);font-size:.87rem}
#act-sheet h1 {margin:22px 0 14px;font-size:1.8rem}
.act-meta {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 24px;margin:0 0 22px}
.act-meta dd {margin:0;overflow-wrap:anywhere;font-weight:600}
.act-table {overflow-x:auto}
.act-table table {font-size:.9rem;width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.act-table th,.act-table td {padding:8px 6px;border-bottom:1px solid var(--line);text-align:right}
.act-table th {background:var(--surface)}
.act-table th:first-child,.act-table td:first-child {text-align:left;min-width:9em;overflow-wrap:anywhere}
.act-total {padding:14px 0;border-bottom:1px solid var(--line);color:var(--ink)}
@page emonter-dokumentas {
  margin:12mm;
  @bottom-left {content:var(--act-print-number);font:9pt Arial,sans-serif}
  @bottom-right {content:"Puslapis " counter(page) " iš " counter(pages);font:9pt Arial,sans-serif}
}
@media print {
  html:has(#act-preview[open]) {background:var(--paper)}
  body:has(#act-preview[open]) > :not(#act-preview) {display:none!important}
  body:has(#act-preview[open]) {page:emonter-dokumentas;background:var(--paper);height:auto;overflow:visible}
  #act-preview[open] {display:block;position:static;inset:auto;width:100%;max-width:none;max-height:none;height:auto;border:0;border-radius:0;margin:0;padding:0;overflow:visible}
  #act-preview::backdrop,#act-preview>.actions {display:none}
  #act-sheet {padding:0}
  .act-table {overflow:visible}
  .act-table thead {display:table-header-group}
  .act-table tr,.act-total,.act-meta {break-inside:avoid}
}
#director-day {margin:14px 0 10px;color:var(--muted)}
#director-shortcuts {display:flex;gap:8px;margin:0 0 16px;flex-wrap:wrap}
#director-shortcuts a {display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:9px 14px;border-radius:8px;background:var(--ink);color:var(--paper);font-weight:650;text-decoration:none}
#director-shortcuts a:hover {background:var(--accent)}
@media(max-width:600px){
  #director-shortcuts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  #director-shortcuts a {grid-column:1/-1}
  #director-shortcuts button {padding:8px 4px;overflow-wrap:anywhere}
}
.director-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:14px}
.director-grid .panel,.director-finance {padding:18px;min-width:0;overflow-wrap:anywhere}
.director-finance {margin-top:16px}
.director-finance h3 {font-size:1rem;margin:16px 0 6px}
.director-finance .stats {margin:12px 0 18px}
.director-finance details {border-top:1px solid var(--line);padding:12px 0}
.director-finance summary {font-weight:700;cursor:pointer}
.director-finance form {display:grid;gap:12px;margin-top:12px}
.director-finance form button,.director-grid button {justify-self:start;margin-top:8px}
.director-finance details[open] > summary > .comparison-state,
.director-finance details:not([open]) > summary > .comparison-state:not(:empty) ~ span {display:none}
.comparison-missing {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}
.comparison-missing button {max-width:100%;white-space:normal;overflow-wrap:anywhere}
.director-item {border-top:1px solid var(--line);margin-top:9px;padding-top:8px}
.director-item small {display:block}
#amount-files,#balance-files,#amount-result,#balance-result {overflow-wrap:anywhere}
#director-message:not(:empty) {font-weight:700;color:var(--ink);border-left:3px solid var(--accent);padding-left:8px}
#login-error,#access-error {color:var(--accent)}
.access-row {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.access-row small {display:block}
.crm-row {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
#crm-portfolio .crm-row {flex-wrap:wrap}
.proposal-reminder {margin:4px 0}
.proposal-reminder button {max-width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere}
#crm-fields [type="checkbox"] {width:auto;justify-self:start}
.preview-facts {display:grid;grid-template-columns:minmax(85px,1fr) minmax(0,3fr);gap:8px 14px;overflow-wrap:anywhere}
.preview-facts dt {font-weight:700}
.preview-facts dd {margin:0;white-space:pre-line}
#project-review details {margin-top:16px}
.gallery-editor{overflow-wrap:anywhere}
.gallery-editor img{display:block;max-width:100%;height:auto;max-height:180px;margin:.5rem 0}
.gallery-editor article{padding:12px 0;border-bottom:1px solid var(--line)}
.gallery-editor form{display:grid;gap:10px;margin:12px 0}
.gallery-editor input[type=file]{max-width:100%;min-width:0}
.gallery-editor .gallery-permission{display:flex;flex-direction:row;align-items:center;gap:8px}
.gallery-editor .gallery-permission input{width:auto}
.gallery-editor summary{cursor:pointer;font-weight:700}
.gallery-editor a{display:block;margin:8px 0}
.gallery-editor p[role=status]:empty{display:none}
#allocation-body form {display:grid;gap:10px}
#allocation-body form>button {justify-self:start}
.allocation-line {display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;align-items:end;gap:8px;margin:9px 0}
.allocation-line select,.allocation-line input {width:100%;min-width:0}
#allocation-dialog,#document-register,#package-register {overflow-wrap:anywhere}
#package-register fieldset {min-width:0;margin:12px 0}
#package-register fieldset label {display:flex;align-items:baseline;gap:8px}
#package-register input[type="checkbox"] {width:auto}
#sub-page {padding-bottom:32px;overflow-wrap:anywhere}
#sub-jobs {display:grid;gap:12px}
#amendment-dialog, #handover-dialog {overflow-wrap:anywhere}
#handover-list .panel {margin-top:12px}
#handover-editor textarea {width:100%;min-height:5em}
#amendment-dialog fieldset {min-width:0;margin:12px 0;border:1px solid var(--line)}
#sub-jobs h3 {margin:14px 0 2px}
#sub-password {margin-top:16px}
#sub-form {margin-top:12px}
#document-register details {margin-top:10px}
#document-register summary {font-weight:650;cursor:pointer}
#document-import label,#document-file {display:block;max-width:100%;margin:10px 0 4px}
#document-register .director-item small {display:block}
#document-list article:focus {outline:3px solid var(--accent);outline-offset:2px}
@media(max-width:560px){.allocation-line{grid-template-columns:minmax(0,1fr) auto}.allocation-line>label:first-child{grid-column:1/-1}}
#crm h2,#crm-fields,#crm-info {margin:12px 0}
#crm-import,#crm-new-project {margin:8px 0}
.crm-filter {margin:12px 0}
#crm-contact-history {border-top:1px solid var(--line);margin-top:16px;padding-top:14px}
#crm-contact-form {display:grid;gap:8px;margin-top:12px}
#crm-contact-form button {justify-self:start}
.crm-contact-entry {border-bottom:1px solid var(--line);padding:8px 0}
.crm-contact-entry p {white-space:pre-wrap;overflow-wrap:anywhere}
.work-month {margin:10px 0;max-width:240px}
#work details {padding:12px 0;border-top:1px solid var(--line)}
#work summary {cursor:pointer;font-weight:700}
#work form {display:grid;gap:10px;justify-items:start;padding-top:12px}
#work form .fields {width:100%}
#work-summary {margin:10px 0}
#work-entries .crm-row {flex-wrap:wrap}
#work-entries .crm-row>div {flex:1 1 240px}
#estimate-tools {padding:14px 0;border-top:1px solid var(--line)}
#estimate-tools summary {cursor:pointer;font-weight:700}
#estimate-tools form {display:grid;justify-items:start;gap:8px;margin:12px 0}
#estimate-result {display:grid;grid-template-columns:1fr auto;gap:4px 12px;max-width:500px}
#estimate-result dd {margin:0}
.estimate-print-title {display:none}
#quote-tools {margin-bottom:20px}
#quote-tools details,#quote-tools form,#quote-document {margin:12px 0}
#quote-tools summary {cursor:pointer;font-weight:700}
#quote-tools .fields {align-items:end}
#quote-lines .fields {margin:8px 0}
#quote-tools .director-item,#quote-document {overflow-wrap:anywhere}
#quote-document .logo {width:130px;height:auto}
@media print {
  body.quote-print > :not(#workspace),body.quote-print #workspace > :not(#crm),
  body.quote-print #crm > :not(#quote-tools),body.quote-print #quote-tools > :not(#quote-document) {display:none!important}
  body.quote-print #crm,body.quote-print #quote-tools {border:0;padding:0}
  body.quote-print #quote-document .director-item {break-inside:avoid}
}
@media print {
  body.estimate-print > :not(#workspace),
  body.estimate-print #workspace > :not(#crm),
  body.estimate-print #crm > :not(#estimate-tools),
  body.estimate-print #estimate-tools > :not(.estimate-print-title,#estimate-result) {display:none!important}
  body.estimate-print {background:var(--paper)}
  body.estimate-print .estimate-print-title {display:grid;gap:12px}
  body.estimate-print #crm,body.estimate-print #estimate-tools {border:0;padding:0}
}
@media(max-width:790px) {.object {grid-template-columns:repeat(2,minmax(0,1fr))}.row-actions {grid-column:1/-1}}
.crm-attachment {min-width:0;overflow-wrap:anywhere}
.crm-attachment summary {cursor:pointer;font-weight:600}
.crm-attachment img {display:block;max-width:100%;height:auto;margin:0.5rem 0}
.crm-attachment div > div:not([hidden]) {display:flex;align-items:center;flex-wrap:wrap;gap:0.5rem}
.crm-attachment p:empty {display:none}
.quantity-table {width:100%;border-collapse:collapse;margin:0.6rem 0;font-variant-numeric:tabular-nums}
.quantity-table caption {text-align:left;font-weight:600;padding:0.4rem 0}
.quantity-table th,.quantity-table td {padding:0.45rem 0.35rem;text-align:left;border-bottom:1px solid var(--line)}
.quantity-table th {background:var(--surface)}
.quantity-table th:last-child,.quantity-table td:last-child {text-align:right}
.quantity-table small {display:block;color:var(--muted)}
.quantity-table td:first-child {width:62%;overflow-wrap:anywhere}
#payslip-review img {display:block;max-width:100%;height:auto;margin:0.6rem auto}
#payslip-review article {margin:0.7rem 0}
#payslip-review select {width:100%;max-width:32rem}
#payslip-review form > label:has(input[type="checkbox"]) {grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;min-height:44px;cursor:pointer}
#payslip-review input[type="checkbox"] {width:22px;height:22px;min-height:0;margin:0;padding:0}
#payslip-review button {max-width:100%;overflow-wrap:anywhere}
#payslip-list button {display:block;margin:0.35rem 0}
#completed-quantities, #month-sheet {background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:16px;margin:16px 0;min-width:0}
#completed-quantities {display:grid;grid-template-columns:2fr 1.4fr 1fr 1fr;gap:12px}
#completed-quantities > :is(h2,div) {grid-column:1/-1;margin:0;min-width:0;overflow:auto}
#completed-quantities label {min-width:0}
#completed-quantities table, #month-sheet table {border-collapse:collapse;width:100%;font-size:.9rem}
#completed-quantities td, #completed-quantities th, #month-sheet td {border:1px solid var(--line);padding:8px;text-align:left}
#completed-quantities th, #month-sheet thead td {background:var(--surface);font-weight:650}
#completed-quantities meter {display:block;width:100%;min-width:75px}
#completed-quantities meter::-webkit-meter-optimum-value {background:var(--accent)}
#completed-quantities td span {white-space:nowrap}
#month-sheet summary {font-size:1.08rem;font-weight:700;cursor:pointer}
#month-sheet > label {display:inline-block;margin:12px 12px 0 0}
#month-sheet .table-wrap {overflow:auto;max-height:60vh}
#month-sheet td {text-align:center;min-width:2.45rem;padding:5px}
#month-sheet td:first-child {position:sticky;left:0;background:var(--surface);text-align:left;min-width:9rem;max-width:11rem}
#month-sheet td:last-child {background:var(--surface);font-weight:700;min-width:5rem}
#month-sheet td button {min-width:7.4rem;font-size:.82rem;line-height:1.35;padding:6px}
#month-sheet .sheet-detail form {display:flex;align-items:end;flex-wrap:wrap;gap:10px}
#month-sheet .sheet-detail label:nth-child(2) {flex:1 1 14rem}
@media(max-width:780px){#completed-quantities{grid-template-columns:repeat(2,minmax(0,1fr))}#completed-quantities label:nth-child(-n+3){grid-column:1/-1}.brand .demo{font-size:.72rem;padding:4px 6px}}
