/* MyERPOne web - look of the approved mockup (Inter, blue #0B6FA4, light grey ground) */
:root{--ink:#171717;--ink2:#2A313C;--muted:#5B6472;--line:#E2E6EC;--line2:#EEF2F6;--bg:#F4F6F9;--card:#fff;
--blue:#0B6FA4;--blue-d:#074E74;--blue-l:#E3F2FA;--sky:#00ACED;--red:#B42318;--orange:#A15C07;--green:#1E7B3E}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:Inter,system-ui,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:14px;line-height:1.45}
a{color:var(--blue);text-decoration:none}a:hover{color:var(--blue-d);text-decoration:underline}
h1{margin:0;font-size:26px;font-weight:700}h2{margin:0;font-size:16px}
.muted{color:var(--muted)}.small{font-size:12px}.strong{font-weight:600}.nowrap{white-space:nowrap}.r{text-align:right}
.sr{position:absolute;left:-9999px}
/* logo */
.logo{font-size:22px;font-weight:700;letter-spacing:-.3px;text-decoration:none!important;white-space:nowrap}
.logo .my,.logo .one{color:var(--sky)}.logo .erp{color:var(--ink)}.logo .one{font-family:Georgia,serif;font-style:italic}
.logo.big{font-size:34px}
/* header */
.top{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:12px 24px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.search{flex:1 1 320px;max-width:560px}
.search input{width:100%;height:40px;padding:0 14px;border:1px solid #D5DAE1;border-radius:8px;font:inherit;background:#F8FAFC}
.top-right{display:flex;align-items:center;gap:12px;margin-left:auto}
.badge{font-size:12px;color:var(--muted);background:var(--line2);padding:4px 10px;border-radius:99px}
.company{font-size:13px;color:var(--ink2);font-weight:500}
.avatar{width:40px;height:40px;border-radius:99px;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600}
.usermenu{position:relative}.usermenu summary{list-style:none;cursor:pointer}.usermenu summary::-webkit-details-marker{display:none}
.usermenu .menu{position:absolute;right:0;top:48px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(20,33,61,.12);min-width:200px;padding:8px;display:flex;flex-direction:column}
.usermenu .menu a,.usermenu .menu button{padding:9px 10px;border-radius:6px;color:var(--ink2);text-align:left;background:none;border:0;font:inherit;cursor:pointer}
.usermenu .menu a:hover,.usermenu .menu button:hover{background:var(--line2);text-decoration:none}
.usermenu .who{padding:8px 10px 10px;border-bottom:1px solid var(--line2);margin-bottom:4px;font-weight:600;display:flex;flex-direction:column}
.usermenu .who small{font-weight:400;color:var(--muted)}
/* frame */
.frame{display:flex;align-items:flex-start}
.side{flex:0 0 232px;padding:16px 12px;display:flex;flex-direction:column;gap:2px;position:sticky;top:65px}
.side a{padding:9px 12px;border-radius:8px;color:var(--ink2)}
.side a:hover{background:#E9EEF4;text-decoration:none}
.side a.on{background:var(--blue-l);color:var(--blue-d);font-weight:600}
.side .sect{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;padding:14px 12px 4px}
.main{flex:1 1 auto;min-width:0;padding:24px 28px 48px;display:flex;flex-direction:column;gap:20px}
.pagehead{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px}
.pagehead p{margin:4px 0 0}
.actions{display:flex;flex-wrap:wrap;gap:8px}
.crumbs{font-size:13px;color:var(--muted);margin-bottom:-12px}
.count{font-weight:700;margin-left:6px}
/* buttons */
.btn{display:inline-flex;align-items:center;height:40px;padding:0 16px;border:1px solid #D5DAE1;border-radius:8px;background:#fff;font:inherit;font-weight:500;color:var(--ink);cursor:pointer;text-decoration:none!important}
.btn:hover{background:#F8FAFC}
.btn.primary{border:0;background:var(--blue);color:#fff;font-weight:600}.btn.primary:hover{background:var(--blue-d)}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn.wide{width:100%;justify-content:center;margin-top:22px}
/* tiles */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.tables{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.tile{display:flex;flex-direction:column;gap:6px;padding:16px 18px;background:#fff;border:1px solid var(--line);border-radius:12px;color:var(--ink);text-decoration:none!important;transition:box-shadow .15s,border-color .15s}
.tile:hover{box-shadow:0 4px 14px rgba(20,33,61,.10);border-color:#CBD3DD}
.tile .cap{font-size:13px;color:var(--muted)}.tile .val{font-size:32px;font-weight:700;line-height:1.1}.tile .hint{font-size:12px;color:var(--muted)}
.tile.small{flex-direction:row;justify-content:space-between;align-items:center;padding:12px 16px}
.tile.small .cap{color:var(--ink2);font-size:14px}.tile .val2{font-weight:700;color:var(--blue)}
.tile.empty{opacity:.55}.tile.empty .val2{color:var(--muted)}
/* cards */
.row{display:flex;flex-wrap:wrap;gap:20px;align-items:flex-start}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px 20px;min-width:0}
.grow3{flex:3 1 520px}.grow2{flex:2 1 340px}.grow1{flex:1 1 260px}
.cardhead{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:8px}
.cardhead a{font-weight:600}
.alert{display:flex;align-items:flex-start;gap:12px;padding:11px 0;border-top:1px solid var(--line2)}
.alert .code,.chip{min-width:48px;text-align:center;font-size:11px;font-weight:700;padding:4px 6px;border-radius:6px;background:var(--line2);color:var(--ink2)}
.chip{margin-left:6px;min-width:0}
.kv{width:100%;border-collapse:collapse;font-size:13px}.kv td{padding:6px 0;border-top:1px solid var(--line2);vertical-align:top}
.kv td:first-child{color:var(--muted);width:150px}
/* grids */
.scroll{overflow-x:auto}
.grid{width:100%;border-collapse:collapse;font-size:13px}
.grid th{text-align:left;font-size:12px;font-weight:600;color:var(--muted);padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
.grid th a{color:var(--muted)}
.grid td{padding:9px 10px;border-top:1px solid var(--line2);vertical-align:top}
.grid tbody tr:hover{background:#F8FAFC}
.pager{display:flex;gap:12px;align-items:center;justify-content:flex-end;margin-top:14px}
.filter{display:flex;gap:8px}.filter input{height:40px;padding:0 12px;border:1px solid #D5DAE1;border-radius:8px;font:inherit;width:240px}
/* record */
.fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:2px 24px;margin:0}
.fields div{padding:8px 0;border-top:1px solid var(--line2)}.fields .wide{grid-column:1/-1}
.fields dt{font-size:12px;color:var(--muted)}.fields dd{margin:2px 0 0;font-weight:500;word-break:break-word}
.relrow{display:flex;justify-content:space-between;gap:12px;padding:10px 4px;border-top:1px solid var(--line2);color:var(--ink2)}
.relrow:hover{background:#F8FAFC;text-decoration:none}
.pill{background:var(--blue-l);color:var(--blue-d);border-radius:99px;padding:1px 9px;font-size:12px;font-weight:600}
/* login */
.login-wrap{min-height:100vh;display:grid;place-items:center;background:var(--bg)}
.login-card{width:380px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:36px 34px;box-shadow:0 12px 40px rgba(20,33,61,.08)}
.login-card .sub{margin:4px 0 22px}
.login-card label{display:block;font-size:13px;font-weight:600;margin:14px 0 6px}
.login-card input[type=text],.login-card input[type=password]{width:100%;height:42px;padding:0 12px;border:1px solid #D5DAE1;border-radius:8px;font:inherit}
input:focus{outline:2px solid var(--sky);outline-offset:0;border-color:transparent}
.error{background:#FDECEA;color:var(--red);border-radius:8px;padding:10px 12px;font-size:14px}
@media (max-width:760px){.side{display:none}.main{padding:16px}.company{display:none}}
/* forms and tabs (phase 3) */
.light{font-weight:400;color:var(--muted)}.red{color:var(--red)}
.tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);margin:-4px 0 14px}
.tabs button{border:0;background:none;font:inherit;padding:10px 14px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;font-weight:500}
.tabs button.on{color:var(--blue-d);border-bottom-color:var(--blue);font-weight:600}
.formgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px 22px}
.formgrid.head{grid-template-columns:200px 280px minmax(260px,1fr)}
.fld{display:flex;flex-direction:column;gap:5px;min-width:0}.fld.full{grid-column:1/-1}
.fld label{font-size:12px;color:var(--muted);font-weight:500}
.fld input[type=text],.fld input:not([type]),.fld select,.fld textarea{height:40px;padding:0 11px;border:1px solid #D5DAE1;border-radius:8px;font:inherit;background:#fff;width:100%}
.fld textarea{height:auto;padding:9px 11px;resize:vertical}
.fld input:disabled,.fld select:disabled{background:#F1F3F6;color:#5B6472}
.fld.off{opacity:.45}
.fld.cb{justify-content:flex-end}.check{display:flex;align-items:center;gap:8px;font-size:14px!important;color:var(--ink)!important;min-height:40px}
.check input{width:18px;height:18px}
.fld .ro{height:40px;display:flex;align-items:center;color:var(--ink2)}
.ferr{color:var(--red);font-size:12px}
.lock{font-size:11px}
.note{border-radius:10px;padding:12px 16px;font-size:14px}.note ul{margin:6px 0 0 18px;padding:0}
.note.ok{background:#E7F4EC;color:var(--green)}.note.err{background:#FDECEA;color:var(--red)}.note.warn{background:#FEF3E2;color:#7A4605}
.filterbar{display:flex;flex-wrap:wrap;gap:8px}.filterbar input,.filterbar select{height:40px;padding:0 12px;border:1px solid #D5DAE1;border-radius:8px;font:inherit;background:#fff}
.filterbar input{flex:1 1 280px;max-width:420px}
tr.deleted td{color:#9AA3AF;text-decoration:line-through}
@media (max-width:760px){.formgrid.head{grid-template-columns:1fr}}
.chip.sup{background:#E3F2FA;color:var(--blue-d)}.chip.cus{background:#E7F4EC;color:var(--green)}.chip.blk{background:#FDECEA;color:var(--red)}
h3.sub{font-size:14px;margin:18px 0 6px}
section.card.off{opacity:.45}
.wide2{grid-column:span 2}
/* BOM */
.st{display:inline-block;font-size:12px;font-weight:600;padding:2px 9px;border-radius:99px;background:var(--line2);color:var(--ink2)}
.st.stR{background:#E7F4EC;color:var(--green)}.st.stC{background:#E3F2FA;color:var(--blue-d)}.st.stB{background:#FDECEA;color:var(--red)}.st.stX{background:#EEF0F3;color:#6B7280}
.levels{font-size:13px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 14px}
.stack{display:flex;flex-direction:column;gap:20px}
.stackform{display:flex;flex-direction:column;gap:6px}.stackform label{font-size:12px;color:var(--muted);margin-top:6px}
.stackform select,.stackform input{height:40px;padding:0 11px;border:1px solid #D5DAE1;border-radius:8px;font:inherit}
.stackform button{margin-top:12px}
.actions form{margin:0}
.btn[aria-disabled]{opacity:.45;cursor:not-allowed}
table.edit td{padding:5px 4px;vertical-align:middle}
table.edit input,table.edit select{height:34px;padding:0 7px;border:1px solid #D5DAE1;border-radius:6px;font:inherit;font-size:13px;width:100%;min-width:48px}
table.edit input[type=checkbox]{width:17px;height:17px;min-width:0}
table.edit td.c{text-align:center}
table.edit .wcomp input{min-width:120px}.table.edit .wnum input{min-width:70px}.table.edit .wop input{min-width:64px}
table.edit td:first-of-type input{max-width:64px}
.fld input[type=date]{height:40px;padding:0 11px;border:1px solid #D5DAE1;border-radius:8px;font:inherit;background:#fff;width:100%}
table.edit select,table.edit input{background:#fff}
table.edit .wdesc input{min-width:150px}table.edit .wnum input{min-width:58px;max-width:80px}
a.chip{text-decoration:none!important;margin-right:4px}
/* ---------- lists closer to the Access datasheet ---------- */
/* fixed column headers: the list scrolls inside its card, the headers stay */
.scroll{max-height:calc(100vh - 230px);overflow:auto}
.grid thead th{position:sticky;top:0;background:#fff;z-index:2;box-shadow:inset 0 -1px 0 var(--line)}
.grid tbody tr:nth-child(even){background:#FBFCFD}
.grid tbody tr.sel{background:var(--blue-l)!important}
/* compact mode (user menu): about twice the lines per screen */
body.compact{font-size:13px}
body.compact .top{padding:6px 16px}
body.compact .search input{height:32px}
body.compact .avatar{width:32px;height:32px;font-size:12px}
body.compact .side{flex-basis:196px;padding:10px 8px;top:45px}
body.compact .side a{padding:5px 10px}
body.compact .main{padding:12px 16px 32px;gap:12px}
body.compact h1{font-size:20px}
body.compact .card{padding:10px 12px;border-radius:8px}
body.compact .grid{font-size:12.5px}
body.compact .grid th{padding:4px 8px}
body.compact .grid td{padding:3px 8px}
body.compact .btn{height:32px;padding:0 12px}
body.compact .filterbar input,body.compact .filterbar select,body.compact .filter input{height:32px}
body.compact .tile{padding:10px 12px;gap:2px}
body.compact .tile .val{font-size:24px}
body.compact .tile.small{padding:7px 12px}
body.compact .tiles{gap:8px}body.compact .tables{gap:6px}
body.compact .formgrid{gap:6px 14px}
body.compact .fld input[type=text],body.compact .fld input:not([type]),body.compact .fld select,body.compact .fld input[type=date]{height:32px}
body.compact .fld .ro{height:32px}
body.compact .fields div{padding:4px 0}
body.compact table.edit td{padding:2px 3px}
body.compact table.edit input,body.compact table.edit select{height:28px}
body.compact .tabs button{padding:6px 12px}
body.compact .scroll{max-height:calc(100vh - 170px)}
body.compact .alert{padding:6px 0}
.usermenu .menu .toggle{display:flex;justify-content:space-between;align-items:center}
.usermenu .menu .toggle span.state{font-size:12px;color:var(--muted)}
/* list tools */
.gridtools{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:-4px 0 8px}
.btn.small{height:30px;padding:0 10px;font-size:13px}
.colpick{position:relative}.colpick summary{list-style:none;cursor:pointer}.colpick summary::-webkit-details-marker{display:none}
.colmenu{position:absolute;right:0;top:36px;z-index:10;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(20,33,61,.12);padding:10px 12px;display:flex;flex-direction:column;gap:4px;min-width:220px;max-height:60vh;overflow:auto}
.colmenu label{display:flex;gap:8px;align-items:center;font-size:13px;white-space:nowrap}
.colmenu .btn{margin-top:8px}
td[data-edit]{cursor:cell}
td[data-edit]:hover{outline:1px dashed #9CC6E0;outline-offset:-2px}
td.saving{opacity:.5}td.saved{background:#E7F4EC!important;transition:background 1s}
input.celledit,select.celledit{height:28px;width:100%;min-width:80px;padding:0 6px;border:1px solid var(--blue);border-radius:5px;font:inherit}
/* planning (phase 4) */
table.sd tr.fixedrow td{background:#F7F9FB}
table.sd tr.short td{background:#FFF6F5}
table.sd tr.seg td{color:var(--muted)}
.seltools{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0 0 8px}
form.inline{display:inline}
pre.small{white-space:pre-wrap;background:#F7F9FB;padding:10px;border-radius:8px}
.filterbar label.check{display:flex;align-items:center;gap:6px;white-space:nowrap}.filterbar label.check input{width:auto;height:auto}
.formgrid label.fld.cb{display:flex;gap:8px;align-items:center;flex-direction:row}
/* dense lists (planning): one line per row, long texts cut off - full text on hover */
.grid.dense td{padding:4px 8px;white-space:nowrap;vertical-align:middle;line-height:1.35}
.grid.dense th{padding:6px 8px}
.grid.dense td.cut{max-width:340px;overflow:hidden;text-overflow:ellipsis}
.grid.dense td.cut.wide{max-width:520px}
.grid.dense .chip{padding:1px 5px;font-size:10.5px;margin-left:0;margin-right:3px}
body.compact .grid.dense td{padding:2px 6px}
/* dispatch board */
table.board tr.dayrow td{background:#EEF3F8;cursor:pointer;border-top:2px solid var(--line)}
table.board tr.dayrow.over td{background:#FDECEA}
table.board tr.mp td{color:var(--muted);font-style:italic}
table.board tr.conf td:first-child{box-shadow:inset 3px 0 0 var(--red)}
table.board input{width:52px;padding:2px 4px;font-size:12px}
.ib{display:inline-block;border:1px solid var(--line);background:#fff;border-radius:5px;padding:0 5px;margin-right:2px;font-size:12px;line-height:20px;cursor:pointer;color:var(--ink);text-decoration:none!important}
.ib:hover{background:var(--blue-l)}.ib.redbg{background:#FDECEA;color:var(--red)}
.bar{display:inline-block;width:60px;height:8px;background:var(--line2);border-radius:4px;vertical-align:middle;overflow:hidden}
.bar span{display:block;height:100%;background:var(--blue)}.bar span.hi{background:#E0A100}.bar span.over{background:var(--red)}
.green{color:var(--green)}

/* dispatch board full screen */
body.wide .top,body.wide .side,body.wide .crumbs{display:none}
body.wide .main{padding:10px 14px 24px;gap:12px}
table.board tr.cont td{color:var(--muted);background:#FAFBFC;font-size:12px}
table.board tr.flash td{background:#FFF3C4;transition:background .3s}
/* flags: text or icon (choice on the board) */
table.board .flicon{display:none;border:1px solid var(--line);background:#fff;border-radius:6px;width:24px;height:22px;padding:0;cursor:pointer;color:var(--blue-d);font-size:13px;line-height:20px}
table.board .flicon.bad{color:#B42318;border-color:#F3B8B2;background:#FEF3F2}
body.flagicon table.board .flicon{display:inline-block}
body.flagicon table.board .fltext{display:none}
body.flagicon table.board td.flagtd{max-width:60px;text-align:center}
.flagpop{position:absolute;z-index:30;background:#FFF6D6;border:1px solid #E8C55A;border-left:4px solid #E0A800;border-radius:6px;box-shadow:0 6px 20px rgba(0,0,0,.15);padding:8px 12px;font-size:13px;line-height:1.45;white-space:normal}
.flagpop div{margin-top:3px}
table.board input.mpseq{border-style:dashed}
/* purchase order items: green fully received, orange partly, red nothing yet */
table.poitems tr.rc-done td{color:var(--green)}table.poitems tr.rc-part td{color:#C46A00}table.poitems tr.rc-none td{color:#B42318}
table.poitems tr.cancelled td{color:var(--muted);text-decoration:line-through}table.poitems tr.cancelled td:last-child{text-decoration:none}
table.poitems input[type=date]{width:128px}table.poitems td a{color:inherit;text-decoration:underline}
.crumbs a.backbtn{display:inline-block;margin-right:14px;padding:3px 10px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--blue-d);font-weight:600;text-decoration:none}
.crumbs a.backbtn:hover{background:var(--blue-l)}
.orange{color:#C46A00}
table.soitems tr.rc-part td{color:var(--blue-d)}
table.grid tr.donerow td{color:#787878;background:#E2EFDA}
table.grid tr.cancelled td{color:var(--muted)}
.grid.dense td.cut.narrow{max-width:170px}
table.grid tr.okrow td{background:#E2EFDA}table.grid tr.red td{color:#C00000}
td.dir{text-align:center;font-size:15px;font-weight:700}td.dir .up{color:#1E8E3E}td.dir .down{color:#C00000}td.dir .same{color:#1565C0}
table.grid tr.selrow td{background:#EEF6FB}
