:root{--orange:#c65b16;--orange-dark:#a94b10;--soft:#fff0e5;--ink:#22272a;--muted:#737775;--line:#e4e5df;--bg:#f5f5f1;--side:#242a2b;--ok:#52745d;--warn:#ac5a20}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;background:var(--bg);font:14px/1.45 Arial,Helvetica,sans-serif;color:var(--ink)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:1px solid var(--line);background:white;border-radius:7px;min-height:40px;padding:8px 14px;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.3}
button:hover{border-color:var(--orange);background:#fff8f2}button:disabled{opacity:.55;cursor:wait}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #e7a16c;outline-offset:2px}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
i[data-icon]{display:inline-flex}
.primary{background:var(--orange);border-color:var(--orange);color:white;font-weight:bold}.primary:hover{background:var(--orange-dark);border-color:var(--orange-dark);color:white}
.textbutton{border:0;padding:3px 4px;background:none;min-height:32px;color:var(--orange);font-size:12px}.textbutton:hover{background:var(--soft)}
.icon-btn{padding:7px;min-width:40px}
.small{font-size:12px}.muted{color:var(--muted)}
h1{font-size:26px;line-height:1.2;letter-spacing:-.6px;margin:0;font-weight:bold}h2{font-size:16px;letter-spacing:-.25px;margin:0}h3{margin:0;font-size:14px}p{margin:0}
.eyebrow{font-size:11px;letter-spacing:1.5px;text-transform:uppercase;color:var(--orange);font-weight:bold;margin-bottom:6px}
label{display:flex;flex-direction:column;gap:6px;font-weight:bold;font-size:12px;margin:14px 0}label small{font-weight:normal;color:var(--muted)}
input,select,textarea{width:100%;min-height:44px;padding:10px 12px;border:1px solid #d9dcd3;border-radius:6px;background:white;font-size:14px;font-weight:normal}
textarea{resize:vertical}input[type=checkbox]{width:22px;height:22px;min-height:0;margin:0}
label.check{flex-direction:row;align-items:center;gap:10px;font-weight:normal;font-size:14px}
fieldset{border:0;margin:14px 0;padding:0}legend{font-weight:bold;font-size:12px;margin-bottom:6px}fieldset p{font-size:12px;color:var(--muted);margin-bottom:8px}
.message{color:#9b2222;font-size:13px;white-space:pre-line;margin:0 0 12px}.message:empty{display:none}.message.ok{color:#2d6a3e}
.note{font-size:12px;padding:12px 13px;background:#f5f4ee;border-radius:6px;margin:14px 0;color:#4a4f4b}
.logo{width:128px;object-fit:contain;mix-blend-mode:multiply;display:block;margin:auto}
/* Login */
.login{min-height:100vh;background:#f4f3ed;display:grid;grid-template-columns:1.05fr 1fr}
.login-hero{background:#292e2c;color:white;padding:55px 8vw;display:flex;flex-direction:column;position:relative;overflow:hidden}
.login-hero:after{content:'';position:absolute;width:400px;height:400px;bottom:-230px;right:-100px;border:70px solid #3d3e32;border-radius:50%}
.login-hero .brand{width:164px;background:white;border-radius:6px;padding:12px 10px}.login-hero .logo{width:140px}
.hero-content{margin:auto 0;z-index:1}.hero-content h1{font-size:clamp(35px,4vw,62px);letter-spacing:-2px;line-height:1.1;margin:0}
.hero-content .rule{width:64px;height:4px;background:#e58443;margin-bottom:30px}.hero-content p{font-size:18px;color:#bfc5ba;margin-top:20px}
.hero-icon{margin-top:60px;color:#e69a65}.hero-icon svg{width:150px;height:100px;stroke-width:.8}.hero-foot{color:#9aa39c;z-index:1}
.login-form{display:flex;flex-direction:column;padding:38px 8vw}.login-form .flags{align-self:flex-end}
.form-body{margin:auto 0;width:100%;max-width:380px;align-self:center}.form-body h2{font-size:25px;margin-bottom:24px}
.form-body .primary{width:100%;margin-top:10px;min-height:46px}
.login-footer{display:flex;justify-content:space-between;align-items:center;color:#757c72;font-size:11px}
/* Flags */
.flags{display:flex;gap:3px}.flags button{padding:5px 7px;border:0;font-size:11px;min-height:32px;background:none}.flags button:hover{background:var(--soft)}.flags .chosen{background:var(--soft);color:var(--orange);font-weight:bold}
/* Shell */
.shell{display:grid;grid-template-columns:204px 1fr;min-height:100vh}
.sidebar{background:var(--side);color:#ccd0cc;padding:30px 16px 20px;display:flex;flex-direction:column;gap:26px;position:sticky;top:0;height:100vh}
.sidebar .brand{background:white;border-radius:6px;padding:12px 9px}
.sidebar nav{display:grid;gap:7px}.sidebar nav button,.sidebar .bottom button{background:none;color:#c5ccca;border:0;justify-content:flex-start;width:100%;min-height:44px;border-radius:7px}
.sidebar nav button:hover,.sidebar .bottom button:hover{background:#30373a;color:white}
.sidebar nav button.active{background:#3c332c;color:#ffae72;box-shadow:inset 3px 0 #e97c31}
.sidebar .bottom{margin-top:auto}.side-caption{font-size:10px;letter-spacing:1.8px;color:#8e9895;padding:0 12px;margin-bottom:9px;text-transform:uppercase}.side-caption.version{margin-top:14px;letter-spacing:0;text-transform:none}
.content{min-width:0}
header{height:74px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 34px;background:white;gap:15px;position:sticky;top:0;z-index:3}
.crumb{font-size:12px;color:var(--muted)}.tools{display:flex;align-items:center;gap:9px}
.sync{font-size:11px;margin-right:10px;display:flex;gap:6px;align-items:center;border:0;background:none;color:var(--muted);min-height:32px;padding:4px 8px}
.sync:before{content:'';height:6px;width:6px;border-radius:50%;background:var(--ok);flex-shrink:0}.sync:hover{background:var(--soft)}
.profile{border-left:1px solid var(--line);padding-left:13px;display:flex;gap:8px;align-items:center;font-size:12px}.avatar{background:#f0f1ed;border-radius:50%;padding:6px;display:flex}
main{max-width:1500px;margin:auto;padding:30px 34px}
.heading{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:15px;margin-bottom:26px}.heading .page-title{grid-column:2;justify-self:center}.heading .heading-actions{grid-column:3;justify-self:end}.heading-actions{display:flex;gap:8px}
.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px}.toolbar .period{margin-right:auto;font-size:12px;color:var(--muted)}
.filters{background:white;border:1px solid var(--line);border-radius:8px;padding:6px 14px 14px;display:grid;grid-template-columns:repeat(6,minmax(100px,1fr));gap:0 14px;margin-bottom:18px;align-items:end}
.filters label{margin:8px 0 0}.filters .search-field{grid-column:span 2}.filters button{margin-top:8px;min-height:44px}
/* KPIs and panels */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:22px}.kpis .kpi:nth-child(n+5){min-height:120px}
.kpi{background:white;border:1px solid var(--line);border-radius:9px;padding:19px;display:block;text-align:left;min-height:135px;color:inherit}
.kpi-top{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px}.kpi-top svg{color:var(--orange)}
.number{font-size:30px;letter-spacing:-1px;margin:12px 0 4px;font-weight:bold}.number span{font-size:17px;font-weight:normal;letter-spacing:0}
.kpi-foot{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;align-items:center}.kpi-foot svg{width:15px;height:15px}
.grid{display:grid;grid-template-columns:1.12fr 1fr;gap:20px;margin-bottom:24px}
.panel{background:white;border:1px solid var(--line);border-radius:9px;overflow:hidden;margin-bottom:20px}
.panel-head{padding:19px 20px 15px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.panel-head p{font-size:11px;color:var(--muted);margin-top:3px}
.panel-foot{border-top:1px solid var(--line);padding:12px 20px;font-size:11px;color:var(--muted);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cost-row{display:grid;grid-template-columns:24px 1fr auto;column-gap:11px;width:100%;border:0;border-radius:0;text-align:left;padding:12px 21px;align-items:center;background:none;color:inherit}
.cost-row:hover{background:#fcfbf7}.cost-row svg{color:var(--muted)}
.bar{height:5px;background:#f1eee9;border-radius:4px;margin-top:8px;overflow:hidden}.bar i{height:100%;display:block;background:#cf7137}
.cost-row.c2 .bar i{background:#e7a273}.cost-row.c3 .bar i{background:#f2cfb3}.cost-value{font-size:14px;font-weight:bold;padding-left:8px;white-space:nowrap}
.activity{padding:0 20px}.activity-row{display:flex;gap:12px;border-bottom:1px solid #eee;padding:12px 0;align-items:center;width:100%;background:none;border-left:0;border-right:0;border-top:0;border-radius:0;text-align:left}
.activity-row:last-child{border-bottom:0}.activity-row:hover{background:#fcfbf7}.activity-symbol{background:#f7f3ed;color:#a45d2f;padding:8px;border-radius:7px;display:flex}.activity-row .info{flex:1;min-width:0}.activity-row p{font-size:11px;color:var(--muted);margin-top:3px}
.status{font-size:11px;white-space:nowrap;color:#697168;display:inline-flex;gap:5px;align-items:center}.status:before{content:'';width:5px;height:5px;background:currentColor;border-radius:50%;flex-shrink:0}
.status.open,.status.assigned{color:var(--warn)}.status.in_progress{color:#2f5f99}.status.completed,.status.done{color:#4a7256}.status.cancelled{color:#8a8f8a}.status.high{color:#a52222}.status.waiting{color:#7a4ea6}.status.problem{color:#a52222}
.works{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.work-head{display:flex;align-items:center;gap:10px;padding:18px 20px;border-bottom:1px solid var(--line)}.country-flag{display:inline-flex}.work-head .right{margin-left:auto;color:var(--muted);font-size:11px;text-align:right}
.machine-row{display:flex;width:100%;border:0;border-bottom:1px solid #edf0e9;border-radius:0;text-align:left;padding:12px 20px;justify-content:flex-start;gap:12px;background:none;align-items:center}.machine-row:last-child{border-bottom:0}.machine-row:hover{background:#fcfbf7}
.machine-icon{width:47px;height:43px;background:#f5f4ef;color:#777f76;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.machine-icon svg{width:34px;height:30px;stroke-width:2.2}
.machine-row .info{flex:1;min-width:0}.machine-row p{font-size:11px;color:var(--muted)}.machine-row .status{margin-left:10px}
.section-heading{display:flex;align-items:center;justify-content:space-between;margin:4px 0 12px;gap:10px}.section-heading p{font-size:11px;color:var(--muted)}
footer{margin-top:24px;display:flex;justify-content:space-between;font-size:11px;color:var(--muted);align-items:center}
/* Tables */
.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:12px}
th{text-align:left;font-size:10px;color:var(--muted);letter-spacing:.6px;text-transform:uppercase;background:#f5f5f0;font-weight:bold}
td,th{padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}td.num,th.num{text-align:right;white-space:nowrap}td .textbutton{white-space:nowrap}
tr.inactive td{color:var(--muted)}tbody tr:hover{background:#fcfbf7}
.empty{padding:36px 20px;text-align:center;color:var(--muted)}
.total{display:flex;justify-content:space-between;border-top:2px solid var(--ink);padding:14px 10px;margin-top:5px;font-weight:bold;gap:12px}
.chips{display:flex;gap:8px;flex-wrap:wrap}.chips button{font-size:12px;min-height:36px}.chips button.chosen{background:var(--soft);border-color:var(--orange);color:var(--orange)}
.chips.big button{min-height:56px;font-size:14px;flex:1}
/* Dialogs */
dialog{border:1px solid var(--line);border-radius:12px;width:min(1100px,calc(100vw - 32px));max-height:94dvh;padding:0;box-shadow:0 25px 100px #1113;color:var(--ink)}#editor,#ticketEditor,#materialEditor,#userEditor,#accountDialog,#captureDialog,#changelogDialog,#discardDialog{width:min(820px,calc(100vw - 32px))}#imprintDialog,#privacyDialog{width:min(720px,calc(100vw - 32px))}.legal h3{margin:16px 0 4px;font-size:14px}.legal p{font-size:13px;color:#4a4f4b;line-height:1.5}#imprintBody .review-row strong{font-weight:normal}#imprintBody a{color:var(--orange)}
#detailDialog,#ticketDialog,#machineDialog,#noticeDialog,#importDialog{width:min(1180px,calc(100vw - 32px))}dialog::backdrop{background:#2229;backdrop-filter:blur(3px)}
.dialog-head{padding:20px 24px;display:flex;justify-content:space-between;align-items:center;gap:14px;border-bottom:1px solid var(--line)}.dialog-head h2{font-size:20px}
.dialog-body{padding:20px 24px}.dialog-foot{position:sticky;bottom:0;background:white;border-top:1px solid var(--line);padding:14px 24px;display:flex;justify-content:space-between;gap:12px}.dialog-foot>div{display:flex;gap:8px}

.stepper{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:12px 24px;background:#f8f8f4}.stepper span{font-size:12px;padding:8px;border-radius:7px;color:var(--muted)}.stepper .active{background:var(--soft);color:var(--orange);font-weight:bold}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.span2{grid-column:1/-1}
.chips-row{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 4px}
.chip{min-height:38px;padding:6px 14px 6px 10px;border:1px solid #d9dcd3;border-radius:999px;background:#fff;font-size:13px;color:#3a403c;gap:8px;transition:border-color .15s,background .15s,box-shadow .15s}.chip svg{width:16px;height:16px;stroke-width:2;color:#8a918c}.chip:hover{border-color:#b9bfb5;background:#fbfbf8}.chip.active{border-color:var(--orange);background:var(--soft);color:var(--orange-dark);font-weight:600;box-shadow:0 1px 2px rgba(198,91,22,.18)}.chip.active svg{color:var(--orange)}
.prio{display:inline-flex;align-items:center;gap:5px;font-size:11px;white-space:nowrap;color:#697168}.prio svg{width:13px;height:13px;stroke-width:2.4}.prio.high{color:#a52222}.prio.low{color:#6f7f88}
.cell-edit{display:inline-flex;align-items:center;gap:5px;justify-content:flex-end}.cell-input{width:84px;min-height:34px;padding:5px 8px;text-align:right;font-size:13px}
.nav-badge{margin-left:auto;background:var(--orange);color:#fff;font-size:11px;font-weight:bold;min-width:20px;height:20px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px}.nav-badge[hidden]{display:none}
.ticket-link{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.ticket-link label{margin-bottom:0}.ticket-link button{min-height:44px;margin-bottom:14px}#printArea .kv th{text-align:left;width:34%;vertical-align:top}
.review-row{display:grid;grid-template-columns:150px 1fr;gap:14px;padding:11px 0;border-bottom:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}.review-row>span{color:var(--muted)}
.conflict-row{display:grid;grid-template-columns:140px 1fr 1fr auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px;overflow-wrap:anywhere}.conflict-row button{min-height:44px}#conflictComparison h3{margin:18px 0 4px}
#loadConflict{width:100%;margin:0 0 14px}
.line-add{display:grid;grid-template-columns:1fr 90px auto;gap:8px;align-items:center}.line-add input{text-align:right}
.estimate{background:var(--soft);border-radius:8px;padding:14px 16px;margin-top:14px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.estimate strong{display:block;font-size:18px}.estimate span{font-size:11px;color:var(--muted)}
.machine-visual{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:170px;background:#f6f5f0;color:#7b817a;padding:20px;gap:10px;border-radius:8px;margin-bottom:14px}
.machine-visual svg{width:130px;height:84px;stroke-width:1.5}.machine-visual p{font-size:14px;color:var(--muted);text-align:center}.machine-visual img{width:100%;height:160px;object-fit:contain}
#photoPreview{max-width:100%;max-height:220px;object-fit:contain;margin:10px 0}#photoTools{margin:10px 0 18px}#photoTools label{margin-top:0}
.detail-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px 18px;margin:0 0 16px}.detail-meta div{font-size:12px;color:var(--muted)}.detail-meta strong{display:block;font-size:14px;color:var(--ink);margin-top:2px}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#252b29;color:white;border-radius:8px;padding:13px 20px;width:max-content;max-width:calc(100vw - 32px);z-index:9;font-size:13px}
.changelog li{margin:6px 0}.changelog ul{padding-left:20px;margin:8px 0 16px}.changelog h3{margin-top:14px}
@media(max-width:1050px){.shell{grid-template-columns:170px 1fr}header{padding:0 20px}.sync span{display:none}main{padding:24px 20px}.kpis{grid-template-columns:repeat(2,1fr)}.grid{grid-template-columns:1fr}.sidebar{padding:25px 12px}.works{gap:12px}.machine-row{padding:12px}.filters{grid-template-columns:repeat(3,1fr)}.filters .search-field{grid-column:span 2}}
@media(max-width:720px){.shell{grid-template-columns:60px 1fr}.sidebar{padding:20px 6px;gap:16px}.sidebar .brand,.sidebar .side-caption,.sidebar button span{display:none}.sidebar nav button,.sidebar .bottom button{justify-content:center;padding:8px}.profile span:last-child,.crumb{display:none}header{height:64px;padding:0 8px}.tools{gap:2px}.sync{display:none}.flags{gap:0}.flags button{padding:3px 2px;min-height:30px}.flags svg.flag{width:22px;height:15px}.profile{padding-left:3px;gap:4px}.avatar{padding:4px}.tools .icon-btn{min-width:34px;padding:5px}
.kpis{gap:9px}.kpi{padding:13px;min-height:120px}.number{font-size:25px}.works{grid-template-columns:1fr}main{padding:16px 12px}.heading{grid-template-columns:1fr}.heading .page-title,.heading .heading-actions{grid-column:1;justify-self:center}.heading .primary{width:100%}h1{font-size:25px}.toolbar{flex-wrap:wrap}.toolbar .period{width:100%;margin-bottom:4px}.grid{gap:14px}.panel-head{padding:15px}.filters{grid-template-columns:1fr 1fr}.filters .search-field,.filters button{grid-column:1/-1}
.login{grid-template-columns:1fr}.login-hero{padding:30px;min-height:300px}.hero-content{margin:35px 0 10px}.hero-content h1{font-size:42px}.hero-icon{display:none}.login-form{padding:25px;min-height:420px}.form-body{padding:25px 0}
.machine-row .status{margin-left:0}.dialog-head,.dialog-body{padding:16px}.dialog-foot{padding:12px 16px}.stepper{padding:10px;gap:3px}.stepper span{font-size:11px;padding:6px;overflow-wrap:anywhere}.form-grid{grid-template-columns:1fr}.span2{grid-column:auto}.chip{flex:1 1 calc(50% - 4px);justify-content:flex-start}
.review-row{grid-template-columns:1fr}.conflict-row{grid-template-columns:1fr}.conflict-row button{width:100%}.estimate{grid-template-columns:1fr}.line-add{grid-template-columns:1fr 80px}.ticket-link{grid-template-columns:1fr}.ticket-link button{margin-bottom:0}.line-add button{grid-column:1/-1}.chips.big{flex-direction:column}
table.cards thead{display:none}table.cards tr{display:block;border-bottom:1px solid var(--line);padding:8px 0}table.cards td{display:flex;justify-content:space-between;gap:10px;border:0;padding:4px 12px;text-align:left}table.cards td:before{content:attr(data-h);color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.6px}table.cards td.num{text-align:right}table.cards td:last-child{justify-content:flex-end}}
.panel-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.flags button{padding:5px 6px;line-height:1}svg.flag{width:26px;height:17px;stroke:none;fill:none;border-radius:2px;box-shadow:0 0 0 1px #0002;display:block}.flags .chosen svg.flag{box-shadow:0 0 0 2px var(--orange)}.country-flag svg.flag{width:30px;height:20px}.print-only{display:none}
@media print{body{background:white}body>*{display:none!important}#printArea.print-only{display:block!important}#printArea{font:11pt/1.4 Arial,sans-serif;color:#000}#printArea h1{font-size:18pt;margin:0 0 4pt}#printArea .meta{font-size:9pt;color:#444;margin-bottom:12pt}#printArea table{width:100%;border-collapse:collapse;font-size:9.5pt}#printArea th,#printArea td{border-bottom:1px solid #999;padding:4pt 6pt;text-align:left;vertical-align:top}#printArea th{background:#eee;font-size:8pt;text-transform:uppercase}#printArea td.num,#printArea th.num{text-align:right;white-space:nowrap}#printArea .total{display:flex;justify-content:space-between;border-top:2px solid #000;padding:6pt;font-weight:bold;margin-top:4pt}#printArea .note{font-size:9pt;color:#444;margin-top:10pt}}

.page-title{display:flex;align-items:center;gap:18px}.page-title h1{font-size:34px;letter-spacing:-.8px}.page-icon{width:64px;height:64px;border-radius:14px;background:var(--soft);color:var(--orange);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.page-icon svg{width:34px;height:34px;stroke-width:1.8}.page-rule{display:block;width:56px;height:3px;background:var(--orange);border-radius:2px;margin-top:6px}.sidebar nav{margin-top:6px}
@media(max-width:720px){.page-icon{width:46px;height:46px}.page-icon svg{width:24px;height:24px}.page-title h1{font-size:24px}.heading{grid-template-columns:1fr}.heading .page-title,.heading .heading-actions{grid-column:1;justify-self:stretch}.heading .page-title{justify-content:center}}
.machine-visual.clickable{width:100%;border:1px dashed #cfd3cb;cursor:pointer;color:#7b817a}.machine-visual.clickable:hover{border-color:var(--orange);background:#fff8f2}.machine-visual img{max-height:220px;width:auto;max-width:100%;object-fit:contain;border-radius:6px}
