:root{
  --bg:#111827;
  --panel:#182335;
  --panel2:#22324a;
  --line:rgba(207,222,240,.18);
  --text:#e8eff8;
  --muted:#b8c7d9;
  --blue:#3577c0;
  --surface:#152033;
  --surface-raised:#213149;
  --input-bg:#142137;
  --table-head:#223149;
  --table-cell:#19263a;
  --header-bg:rgba(17,24,39,.96);
  --hover-bg:rgba(153,192,231,.09);
  --focus-ring:#8dccff;
  --green:#16863b;
  --green2:#22a64c;
  --red:#d83c43;
  --radius:16px;
  color-scheme:dark;
  font-family:Inter,"Segoe UI",ui-sans-serif,-apple-system,BlinkMacSystemFont,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{min-height:100vh}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:default}
[hidden]{display:none!important}
.app-shell{min-height:100vh}
.view{min-height:100vh}
.login-view{display:grid;place-items:center;padding:28px 18px}
.login-card{width:min(420px,100%);display:flex;flex-direction:column;gap:16px}
.brand-logo{width:42px;height:42px;object-fit:contain}
.login-logo{width:92px;height:92px;margin:0 auto 2px}
.brand-name{text-align:center;font-size:31px;font-weight:850;letter-spacing:.2px}
.brand-subtitle{text-align:center;color:var(--muted);margin-top:-10px;margin-bottom:18px}
.field{display:flex;flex-direction:column;gap:8px}
.field>span{font-size:11px;font-weight:800;letter-spacing:.7px;color:var(--muted)}
.field input,.field select,.search-field input,.ready-input{
  width:100%;min-height:52px;border:1px solid var(--line);border-radius:13px;
  background:var(--input-bg);color:var(--text);padding:0 14px;outline:none;font-size:16px
}
.field input:focus,.field select:focus,.search-field input:focus,.ready-input:focus{border-color:rgba(2,110,245,.9)}
.primary-button,.secondary-button,.timer-button,.operation-button{
  min-height:56px;border:0;border-radius:14px;font-weight:850;letter-spacing:.35px
}
.primary-button{background:var(--blue);color:#fff}
.primary-button:disabled{background:#263140;color:rgba(255,255,255,.35)}
.secondary-button{background:var(--surface-raised);color:#fff}
.link-button{display:flex;align-items:center;justify-content:center;text-decoration:none}
.form-message{min-height:20px;color:var(--muted);font-size:13px;text-align:center}
.form-message.error{color:#ff8c91}
.form-message.success{color:#79df9a}
.app-header{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;
  gap:12px;min-height:66px;padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));
  background:rgba(7,11,18,.94);border-bottom:1px solid var(--line);backdrop-filter:blur(14px)
}
.brand-button{display:flex;align-items:center;gap:9px;background:none;border:0;color:#fff;font-size:18px;font-weight:850;padding:0}
.header-right{display:flex;align-items:center;gap:10px;min-width:0}
.user-name{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:13px}
.header-action,.icon-button,.back-button{
  border:1px solid var(--line);background:var(--surface);color:#fff;border-radius:11px;font-weight:800
}
.header-action{min-height:38px;padding:0 11px;font-size:11px}
.icon-button{width:42px;height:42px;font-size:22px}
.app-main{width:min(760px,100%);margin:0 auto;padding:20px 18px calc(30px + env(safe-area-inset-bottom))}
.screen{min-height:calc(100vh - 110px)}
.screen-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}
.screen-heading h1{margin:2px 0 0;font-size:27px}
.eyebrow{font-size:11px;font-weight:850;letter-spacing:1px;color:var(--muted)}
.search-field{display:block;margin-bottom:9px}
.section-meta{min-height:18px;margin:0 2px 10px;color:var(--muted);font-size:12px}
.orders-list{display:flex;flex-direction:column;gap:10px}
.order-card{
  width:100%;display:grid;grid-template-columns:1fr auto;gap:8px 14px;align-items:center;
  border:1px solid var(--line);border-radius:15px;background:var(--panel);color:#fff;padding:15px 16px;text-align:left
}
.order-card:active{background:var(--panel2)}
.order-card-main{min-width:0}
.order-card-number{font-size:18px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-card-code{margin-top:4px;color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-card-progress{text-align:right;font-variant-numeric:tabular-nums}
.order-card-progress strong{display:block;font-size:17px}
.order-card-progress span{font-size:11px;color:var(--muted)}
.empty-state{display:flex;flex-direction:column;gap:7px;align-items:center;justify-content:center;padding:54px 24px;text-align:center;color:var(--muted)}
.empty-state strong{color:#fff}
.workorder-card-screen{position:relative;padding-top:0}
.back-button{width:44px;height:44px;font-size:23px;margin-bottom:4px}
.back-button:disabled{opacity:.28}
.workorder-card-header{text-align:center;margin-top:-2px}
.card-label{color:rgba(255,255,255,.58);font-size:18px;font-weight:800;letter-spacing:.25px}
.card-workorder{margin-top:8px;font-size:18px;font-weight:800;letter-spacing:.25px}
.card-product{margin-top:14px;font-size:18px;font-weight:800}
.card-progress{display:flex;justify-content:space-between;gap:18px;margin-top:11px;color:var(--muted);font-size:15px;font-weight:750}
.operation-button{width:100%;margin-top:22px;background:var(--surface-raised);color:#fff}
.operation-button.operation-needed{background:var(--green);color:#fff}
.operation-button:disabled{opacity:.55}
.timer-panel{display:flex;flex-direction:column;gap:12px;align-items:stretch;margin-top:22px}
.timer-value{text-align:center;font-size:42px;font-weight:900;letter-spacing:1.5px;font-variant-numeric:tabular-nums}
.timer-button.start,.timer-button.restart{background:var(--green);color:#fff}
.timer-button.stop{background:var(--red);color:#fff}
.timer-button{width:100%}
.operation-totals{
  max-height:220px;overflow-y:auto;overscroll-behavior:contain;margin-top:22px;border-top:1px solid var(--line)
}
.operation-total-row{display:flex;justify-content:space-between;gap:18px;min-height:48px;align-items:center;border-bottom:1px solid var(--line)}
.operation-total-row span{color:var(--muted);font-size:13px;font-weight:800}
.operation-total-row strong{font-variant-numeric:tabular-nums}
.modal{
  position:fixed;inset:0;z-index:100;display:flex;align-items:flex-end;justify-content:center;
  padding:16px;background:rgba(0,0,0,.64)
}
.modal-sheet{
  width:min(540px,100%);max-height:90vh;overflow:auto;border:1px solid var(--line);
  border-radius:20px;background:var(--input-bg);padding:18px
}
.modal-title{text-align:center;font-size:18px;font-weight:900;margin:4px 0 15px}
.modal-info{text-align:center;color:var(--muted);margin-bottom:14px}
.operation-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;overflow:hidden;margin-bottom:13px}
.operation-list button{min-height:58px;border:0;border-bottom:1px solid var(--line);background:var(--surface);color:#fff;font-weight:850;text-align:left;padding:0 16px}
.operation-list button:last-child{border-bottom:0}
.operation-list button.selected{background:var(--surface-raised)}
.ready-input{text-align:center;font-size:25px;font-weight:850;margin-bottom:13px}
.toast{position:fixed;z-index:120;left:50%;bottom:24px;transform:translateX(-50%);max-width:min(90vw,520px);padding:12px 16px;border-radius:12px;background:var(--panel2);color:#fff;border:1px solid var(--line);text-align:center;font-size:13px}
.admin-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.admin-card,.admin-list-card{border:1px solid var(--line);border-radius:16px;background:var(--panel);padding:16px}
.admin-card{display:flex;flex-direction:column;gap:12px}
.admin-card h2,.admin-list-card h2{margin:0 0 4px;font-size:17px}
.admin-message{margin:14px 0}
.admin-lists{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.admin-list-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.admin-list-row:last-child{border-bottom:0}
.admin-list-row small{color:var(--muted)}
.setup-body{display:grid;place-items:center;min-height:100vh;padding:24px}
.setup-card{width:min(480px,100%);border:1px solid var(--line);border-radius:18px;background:var(--panel);padding:22px}
.setup-logo{display:block;width:88px;height:88px;margin:0 auto}
.setup-card h1{text-align:center;margin:8px 0 18px}
.setup-card p{color:var(--muted);line-height:1.55}
.setup-form{display:flex;flex-direction:column;gap:14px}
.setup-message{padding:12px;border-radius:11px;margin-bottom:14px}
.setup-message.success{background:rgba(22,134,59,.17);color:#8ce2a6}
.setup-message.error{background:rgba(216,60,67,.15);color:#ff989c}
@media(max-width:720px){
  .admin-grid,.admin-lists{grid-template-columns:1fr}
  .user-name{display:none}
}
@media(min-width:721px){
  .app-main{padding-top:28px}
}

.timer-panel[hidden]{display:none!important}


/* Compact administration navigation */
.admin-menu{
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:var(--panel);
}
.admin-menu-row{
  width:100%;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 16px;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--text);
  text-align:left;
  font-size:16px;
  font-weight:750;
}
.admin-menu-row:last-child{border-bottom:0}
.admin-menu-row:active{background:var(--panel2)}
.admin-menu-arrow{
  flex:0 0 auto;
  color:var(--muted);
  font-size:28px;
  font-weight:400;
  line-height:1;
}
.admin-subscreen-heading{
  justify-content:flex-start;
  align-items:flex-start;
}
.admin-subscreen-heading .back-button{
  flex:0 0 auto;
  margin:0 2px 0 0;
}
.admin-subscreen-title{
  min-width:0;
  padding-top:1px;
}
.admin-subscreen-title h1{
  margin:2px 0 0;
  font-size:27px;
}
.admin-form-card{
  display:flex;
  flex-direction:column;
  gap:14px;
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  padding:16px;
}
.admin-list-full{
  width:100%;
}
.admin-subscreen .admin-list-row{
  min-height:50px;
  align-items:center;
}


.lookup-status{
  min-height:18px;
  margin-top:-7px;
  font-size:12px;
  color:var(--muted);
}
.lookup-status.found,.bom-row-status.found{color:#79df9a}
.lookup-status.missing,.bom-row-status.missing{color:#ff8c91}
.lookup-status.checking,.bom-row-status.checking{color:var(--muted)}

.bom-section{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:4px;
  padding-top:4px;
}
.bom-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.bom-heading>span{
  font-size:11px;
  font-weight:800;
  letter-spacing:.7px;
  color:var(--muted);
}
.small-action-button,.bom-create-link{
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--table-head);
  color:#fff;
  font-weight:800;
}
.small-action-button{
  min-height:34px;
  padding:0 11px;
  font-size:11px;
}
.bom-help{
  margin-top:-5px;
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
}
.bom-rows{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.bom-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
  gap:8px;
  align-items:start;
}
.bom-field-wrap{
  min-width:0;
}
.bom-code-input{
  width:100%;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--text);
  padding:0 13px;
  outline:none;
}
.bom-code-input:focus{border-color:rgba(2,110,245,.9)}
.bom-row-status{
  min-height:17px;
  padding:5px 2px 0;
  color:var(--muted);
  font-size:12px;
}
.bom-remove-button{
  width:42px;
  height:48px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--table-head);
  color:var(--muted);
  font-size:24px;
}
.bom-missing-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:6px;
}
.bom-create-link{
  min-height:30px;
  padding:0 9px;
  font-size:10px;
}
.catalog-list{
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:var(--panel);
}
.catalog-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  min-height:58px;
  padding:10px 15px;
  border-bottom:1px solid var(--line);
}
.catalog-row:last-child{border-bottom:0}
.catalog-row-main{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.catalog-row-main strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.catalog-row-main span{
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.catalog-row-side{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.catalog-loading{
  padding:20px;
  color:var(--muted);
  text-align:center;
}


/* Edit managers */
.admin-subscreen-heading-inline{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.admin-subscreen-heading-inline .back-button{margin:0}
.manager-new-button{
  min-width:82px;
  background:var(--blue);
  border-color:transparent;
}
.manager-message{
  min-height:20px;
  margin:0 2px 8px;
  text-align:left;
}
.manager-list{
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:var(--panel);
}
.manager-row{
  width:100%;
  min-height:62px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding:10px 15px;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--text);
  text-align:left;
}
.manager-row:last-child{border-bottom:0}
.manager-row:active{background:var(--panel2)}
.manager-row-main{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.manager-row-main strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:15px;
}
.manager-row-main small{
  margin-top:4px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.manager-row-side{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.editor-meta{
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}
.danger-button{
  min-height:52px;
  border:1px solid rgba(216,60,67,.55);
  border-radius:13px;
  background:rgba(216,60,67,.12);
  color:#ff989c;
  font-weight:850;
  letter-spacing:.25px;
}
.danger-button:active{
  background:rgba(216,60,67,.22);
}


/* BOM quantity + unit */
.bom-row{
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:13px;
  background:rgba(255,255,255,.018);
}
.bom-row-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) 42px;
  gap:8px;
  align-items:start;
}
.bom-measure-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);
  gap:8px;
}
.bom-quantity-input,.bom-unit-select{
  width:100%;
  min-height:44px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--input-bg);
  color:var(--text);
  padding:0 12px;
  outline:none;
}
.bom-quantity-input:focus,.bom-unit-select:focus{
  border-color:rgba(2,110,245,.9);
}


/* BOM unit is derived from component and cannot be edited */
.bom-unit-display{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  font-weight:800;
  text-transform:lowercase;
  user-select:none;
}
.bom-unit-display.empty{
  color:var(--muted);
  font-weight:600;
  text-transform:none;
}


/* System-generated immutable values */
.field input[readonly]{
  background:rgba(255,255,255,.035);
  color:var(--muted);
  cursor:default;
}


.editor-copy-button{
  width:100%;
}


/* Product routing */
.routing-section{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
.routing-rows{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.routing-row{
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 42px;
  gap:8px;
  align-items:start;
  padding:10px;
  border:1px solid var(--line);
  border-radius:13px;
  background:rgba(255,255,255,.018);
}
.routing-step-number{
  width:32px;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}
.routing-code-input{
  width:100%;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--text);
  padding:0 13px;
  outline:none;
}
.routing-code-input:focus{
  border-color:rgba(2,110,245,.9);
}


.operation-list-empty{
  padding:18px 16px;
  color:var(--muted);
  line-height:1.4;
}


/* Routing standard time */
.routing-row{
  grid-template-columns:32px minmax(0,1fr) 42px;
}
.routing-row-main{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.routing-time-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);
  gap:8px;
}
.routing-time-input,
.routing-time-unit{
  width:100%;
  min-height:44px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--input-bg);
  color:var(--text);
  padding:0 12px;
  outline:none;
}
.routing-time-input:focus,
.routing-time-unit:focus{
  border-color:rgba(2,110,245,.9);
}


/* Routing operation line + total */
.routing-operation-line{
  display:grid;
  grid-template-columns:minmax(90px, 145px) minmax(0,1fr) 42px;
  gap:10px;
  align-items:center;
}
.routing-operation-name{
  min-height:48px;
  display:flex;
  align-items:center;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text);
  font-size:16px;
  font-weight:600;
}
.routing-code-input{
  min-width:0;
  font-size:16px;
}
.routing-status{
  min-height:0;
}
.routing-status:empty{
  display:none;
}
.routing-total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-top:4px;
  padding:14px 2px 2px;
  border-top:1px solid var(--line);
  font-size:14px;
  font-weight:800;
}
.routing-total span{
  color:var(--muted);
  letter-spacing:.5px;
}
.routing-total strong{
  color:var(--text);
  font-size:18px;
}


/* BOM code + item name on one line */
.bom-row-top{
  display:block;
}
.bom-row-main{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.bom-item-line{
  display:grid;
  grid-template-columns:minmax(90px, 145px) minmax(0,1fr) 42px;
  gap:10px;
  align-items:center;
}
.bom-item-name{
  min-height:48px;
  display:flex;
  align-items:center;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text);
  font-size:16px;
  font-weight:600;
}
.bom-code-input{
  min-width:0;
  font-size:16px;
}
.bom-status{
  min-height:0;
}
.bom-status:empty{
  display:none;
}


/* Production Plan */
.production-plan-screen{
  width:100%;
  max-width:none;
}
.production-plan-heading{
  margin-bottom:10px;
}
.production-plan-toolbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.production-plan-nav{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.production-plan-date-field{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.5px;
}
.production-plan-date-field input{
  min-height:38px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--input-bg);
  color:var(--text);
}
.production-plan-search{
  margin-bottom:8px;
}
.production-plan-meta{
  min-height:24px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:0 2px 6px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.production-plan-scroll{
  width:100%;
  max-height:calc(100vh - 285px);
  min-height:320px;
  overflow:auto;
  overscroll-behavior:contain;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--table-cell);
}
.production-plan-grid{
  min-width:max-content;
}
.production-plan-row{
  display:grid;
  align-items:stretch;
  border-bottom:1px solid var(--line);
}
.production-plan-row:last-child{
  border-bottom:0;
}
.production-plan-header{
  position:sticky;
  top:0;
  z-index:15;
  background:var(--table-head);
}
.production-plan-cell{
  min-width:0;
  border-right:1px solid var(--line);
}
.production-plan-cell:last-child{
  border-right:0;
}
.production-plan-code{
  position:sticky;
  left:0;
  z-index:9;
  display:flex;
  align-items:center;
  min-height:64px;
  padding:10px 12px;
  background:var(--panel);
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
}
.production-plan-corner{
  z-index:20;
  min-height:54px;
  color:var(--muted);
  font-size:11px;
  letter-spacing:.6px;
}
.production-plan-date-header{
  min-height:54px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding:6px;
  background:var(--table-head);
  text-align:center;
}
.production-plan-date-header small{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
}
.production-plan-date-header strong{
  font-size:13px;
}
.production-plan-date-header.today{
  box-shadow:inset 0 -3px 0 var(--blue);
}
.production-plan-date-header.past{
  opacity:.55;
}
.production-plan-date-cell{
  min-height:64px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:5px;
  padding:5px;
  background:var(--table-cell);
  transition:background .12s ease, box-shadow .12s ease;
}
.production-plan-date-cell.past{
  background:rgba(255,255,255,.012);
}
.production-plan-date-cell.drop-target{
  background:rgba(16,119,255,.12);
  box-shadow:inset 0 0 0 2px rgba(16,119,255,.7);
}
.production-plan-order{
  min-height:46px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:1px;
  padding:5px 7px;
  border:1px solid rgba(45,128,255,.45);
  border-radius:9px;
  background:rgba(16,119,255,.13);
  cursor:grab;
  user-select:none;
  touch-action:manipulation;
}
.production-plan-order:active{
  cursor:grabbing;
}
.production-plan-order strong{
  color:var(--text);
  font-size:17px;
  line-height:1.05;
}
.production-plan-order small{
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  white-space:nowrap;
}
.production-plan-order.dragging{
  opacity:.45;
}
.production-plan-order.selected{
  box-shadow:0 0 0 2px var(--blue);
}
.production-plan-order.completed{
  opacity:.5;
  cursor:default;
  border-style:dashed;
}
.production-plan-loading,
.production-plan-empty{
  min-width:320px;
  padding:24px;
}
@media (max-width:700px){
  .production-plan-scroll{
    max-height:calc(100vh - 315px);
  }
  .production-plan-toolbar{
    align-items:stretch;
  }
  .production-plan-date-field{
    justify-content:space-between;
  }
}


/* Production Plan Work Order edit */
.production-plan-order-footer{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.production-plan-order-footer small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.production-plan-edit{
  width:22px;
  height:22px;
  flex:0 0 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size:14px;
  line-height:1;
  cursor:pointer;
}
.production-plan-edit:hover,
.production-plan-edit:focus-visible{
  background:rgba(255,255,255,.08);
  color:var(--text);
}
.production-plan-order-quantity{
  font-variant-numeric:tabular-nums;
}


/* Production Plan duration scheduler */
body.production-plan-open{
  overflow:hidden;
}
.production-plan-screen:not([hidden]){
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  flex-direction:column;
  width:100vw;
  max-width:none;
  height:100dvh;
  padding:18px 22px 16px;
  overflow:hidden;
  background:var(--bg);
}
.production-plan-screen .production-plan-heading{
  flex:0 0 auto;
  margin:0 0 10px;
}
.production-plan-screen .production-plan-toolbar,
.production-plan-screen .production-plan-search,
.production-plan-screen .production-plan-meta,
.production-plan-screen .manager-message{
  flex:0 0 auto;
}
.production-plan-screen .production-plan-scroll{
  flex:1 1 auto;
  width:100%;
  min-height:0;
  max-height:none;
  overflow:auto;
  border-radius:12px;
}
.production-plan-mode-toggle{
  min-width:112px;
}
.production-plan-schedule-row{
  position:relative;
}
.production-plan-background-cell{
  z-index:1;
  min-height:54px;
  background:var(--table-cell);
}
.production-plan-background-cell.weekend,
.production-plan-date-header.weekend{
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,.025),
      rgba(255,255,255,.025) 7px,
      rgba(255,255,255,.055) 7px,
      rgba(255,255,255,.055) 14px
    ),
    #0c121b;
}
.production-plan-date-header.weekend small,
.production-plan-date-header.weekend strong{
  color:#8a94a4;
}
.production-plan-background-cell.weekend{
  cursor:not-allowed;
}
.production-plan-background-cell.droppable{
  cursor:pointer;
}
.production-plan-code{
  z-index:6;
}
.production-plan-order{
  position:relative;
  z-index:4;
  align-self:stretch;
  margin:5px;
  min-width:0;
}
.production-plan-order-span{
  flex-direction:column;
  justify-content:center;
  align-items:stretch;
  min-height:44px;
  background:rgba(16,119,255,.20);
  border-color:rgba(45,128,255,.72);
}
.production-plan-order-main{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.production-plan-order-duration{
  flex:0 0 auto;
  color:#a9c9ff;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}
.production-plan-order-footer{
  justify-content:space-between;
}
.production-plan-order-span.clipped-start{
  border-left-style:dashed;
  border-top-left-radius:3px;
  border-bottom-left-radius:3px;
}
.production-plan-order-span.clipped-end{
  border-right-style:dashed;
  border-top-right-radius:3px;
  border-bottom-right-radius:3px;
}
.production-plan-order.missing-duration{
  border-color:#bd8b33;
  background:rgba(189,139,51,.13);
}
.production-plan-order.missing-duration .production-plan-order-duration{
  color:#e8bd6f;
}
.production-plan-order.invalid-weekend-start{
  border-color:#d76464;
}
.production-plan-background-cell.drop-target{
  z-index:2;
}
@media (max-width:700px){
  .production-plan-screen:not([hidden]){
    padding:12px 10px 10px;
  }
  .production-plan-screen .production-plan-scroll{
    max-height:none;
  }
}


/* Production Plan drag/drop grid fix */
.production-plan-schedule-row{
  min-width:max-content;
}
.production-plan-lane-cell{
  min-height:54px;
}
.production-plan-empty-timeline-row{
  min-height:54px;
}
.production-plan-grid.is-dragging .production-plan-background-cell.droppable{
  cursor:copy;
}
.production-plan-grid.is-dragging .production-plan-background-cell.droppable:hover{
  background:rgba(16,119,255,.10);
}
.production-plan-background-cell{
  box-sizing:border-box;
}
.production-plan-row{
  min-width:max-content;
}


/* Production Plan drag/drop fix v2 */
.production-plan-grid{
  width:max-content;
  max-width:none;
}
.production-plan-row{
  max-width:none;
}
.production-plan-grid.is-dragging .production-plan-background-cell.drop-target{
  background:rgba(16,119,255,.20);
  box-shadow:inset 0 0 0 2px rgba(16,119,255,.9);
}
.production-plan-grid.is-dragging .production-plan-order{
  opacity:.72;
}
.production-plan-grid.is-dragging .production-plan-order.dragging{
  opacity:.36;
}


/* Production Plan coordinate drag/drop */
.production-plan-grid.is-dragging{
  cursor:grabbing;
}
.production-plan-grid.is-dragging .production-plan-order:not(.dragging){
  opacity:.88;
}
.production-plan-grid.is-dragging .production-plan-background-cell.drop-target{
  position:relative;
  z-index:8;
  background:rgba(16,119,255,.22);
  box-shadow:inset 0 0 0 2px rgba(16,119,255,.92);
}


/* Warehouses / stock */
.stock-item-field{
  display:grid;
  grid-template-columns:minmax(135px,180px) minmax(0,1fr);
  gap:12px;
  align-items:end;
}
.stock-item-name{
  min-height:48px;
  display:flex;
  align-items:center;
  min-width:0;
  padding:0 2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text);
  font-size:16px;
  font-weight:650;
}
.stock-quantity-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(110px,.7fr);
  gap:12px;
}
.stock-unit-display{
  min-height:48px;
  display:flex;
  align-items:center;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  font-weight:800;
}
.warehouse-balance-card{
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:var(--panel);
}
.warehouse-balance-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:15px 16px;
  border-bottom:1px solid var(--line);
}
.warehouse-balance-heading>div:first-child{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.warehouse-balance-heading>div:first-child strong{font-size:18px}
.warehouse-balance-heading>div:first-child span{
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.warehouse-balance-total{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  flex:0 0 auto;
}
.warehouse-balance-total span{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.6px;
}
.warehouse-balance-total strong{
  margin-top:2px;
  font-size:18px;
}
.warehouse-balance-list{display:flex;flex-direction:column}
.warehouse-balance-row{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 16px;
  border-bottom:1px solid var(--line);
}
.warehouse-balance-row:last-child{border-bottom:0}
.warehouse-balance-row strong{font-size:15px}
.warehouse-balance-row span{
  font-size:15px;
  font-variant-numeric:tabular-nums;
}
.warehouse-balance-row.zero{color:var(--muted)}
.warehouse-balance-empty{padding:18px 16px;color:var(--muted)}
@media(max-width:620px){
  .stock-item-field{
    grid-template-columns:minmax(110px,145px) minmax(0,1fr);
  }
  .stock-quantity-row{
    grid-template-columns:minmax(0,1fr) 110px;
  }
}


/* Users management */
.users-create-section{
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line);
}
.users-create-title{
  margin:0 0 10px;
  font-size:17px;
  font-weight:850;
}
.admin-user-row{
  width:100%;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto 24px;
  gap:12px;
  align-items:center;
  border:0;
  border-bottom:1px solid var(--line);
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.admin-user-row:last-child{border-bottom:0}
.admin-user-row:active{background:var(--panel2)}
.admin-user-main{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.admin-user-main strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
}
.admin-user-main small{
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.admin-user-role{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}


/* Purchase / Customer orders */
.commercial-order-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.commercial-order-number-field{
  max-width:220px;
}
.commercial-order-number-field input{
  font-weight:900;
  letter-spacing:.4px;
}
.commercial-order-lines-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:6px;
}
.commercial-order-lines-heading strong{
  font-size:12px;
  letter-spacing:.7px;
}
.commercial-order-lines{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.commercial-order-line{
  display:grid;
  grid-template-columns:minmax(170px,1.8fr) minmax(90px,.7fr) minmax(70px,.5fr) minmax(130px,.9fr) 42px;
  gap:10px;
  align-items:start;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
}
.commercial-order-code-group{
  min-width:0;
}
.commercial-order-description{
  min-height:18px;
  margin:4px 2px 0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
}
.commercial-order-code-status{
  min-height:17px;
  margin-top:2px;
}
.commercial-order-remove{
  width:42px;
  height:48px;
  margin-top:20px;
  border:1px solid var(--line);
  border-radius:12px;
  background:transparent;
  color:var(--text);
  font-size:25px;
  line-height:1;
  cursor:pointer;
}
.commercial-order-remove:active{
  background:var(--panel2);
}
@media(max-width:760px){
  .commercial-order-line{
    grid-template-columns:minmax(0,1fr) 95px 72px;
  }
  .commercial-order-code-group{
    grid-column:1 / -1;
  }
  .commercial-order-date-field{
    grid-column:1 / 3;
  }
  .commercial-order-remove{
    grid-column:3;
    grid-row:3;
  }
}


/* Purchase order receiving */
.commercial-order-line{
  position:relative;
}
.purchase-receipt-panel{
  grid-column:1 / -1;
  padding-top:10px;
  border-top:1px solid var(--line);
}
.purchase-receive-toggle{
  min-height:38px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:transparent;
  color:var(--text);
  font-weight:850;
  cursor:pointer;
}
.purchase-receive-toggle:active{
  background:var(--panel2);
}
.purchase-receipt-form{
  display:grid;
  grid-template-columns:minmax(120px,1fr) minmax(120px,1fr) minmax(80px,.6fr) minmax(140px,1fr);
  gap:10px;
  align-items:end;
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.purchase-receipt-form[hidden]{
  display:none!important;
}
.purchase-receipt-submit{
  grid-column:1 / -1;
}
.purchase-receipt-message{
  grid-column:1 / -1;
}
.commercial-order-received{
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
}
@media(max-width:760px){
  .purchase-receipt-form{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .purchase-receipt-form .field:nth-child(3){
    grid-column:auto;
  }
}


/* Planner read-only area, isolated from existing production screens */
body.planner-open .app-main {width:min(1480px,100%);padding:24px 24px 60px}
.planner-view{display:grid;grid-template-columns:224px minmax(0,1fr);gap:30px;min-height:calc(100vh - 135px)}
.planner-sidebar{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:22px 12px;align-self:start;position:sticky;top:90px}
.planner-sidebar-title{font-size:13px;font-weight:900;letter-spacing:1px;padding:0 12px 22px}
.planner-sidebar-title span{display:block;margin-top:5px;color:var(--muted);font-size:10px;letter-spacing:2px}
.planner-nav{display:grid;gap:5px}
.planner-nav-item{display:flex;align-items:center;gap:13px;width:100%;border:0;border-radius:10px;background:transparent;color:#a9b9cb;text-align:left;padding:13px 12px;font-size:15px;font-weight:650}
.planner-nav-item.is-active,.planner-nav-item:hover{background:rgba(2,110,245,.16);color:#fff}
.planner-nav-item span{flex:1}
.planner-sidebar-foot{margin:28px 12px 0;padding-top:20px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
.planner-main{min-width:0}
.planner-topline{display:flex;justify-content:space-between;align-items:center;margin:3px 0 23px;color:#a9b9cb;font-size:12px;font-weight:700;letter-spacing:.3px}
.planner-readonly{color:#8aafeb;border:1px solid #375275;border-radius:30px;padding:6px 11px;font-size:10px;letter-spacing:1px}
.planner-title{font-size:30px;line-height:1.2;letter-spacing:-.6px;margin:0 0 8px}
.planner-muted{color:var(--muted);font-size:14px;margin:0 0 19px}
.planner-source{color:#83a5c7;font-size:12px;margin:0 0 22px}
.planner-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 30px}
.planner-metric{display:flex;flex-direction:column;gap:12px;border:1px solid var(--line);border-radius:15px;padding:17px 18px;background:var(--panel)}
.planner-metric span{color:var(--muted);font-size:12px}
.planner-metric strong{font-size:28px;line-height:1.15;font-weight:800;overflow-wrap:anywhere}
.planner-group{margin:0 0 30px}
.planner-group h2{font-size:19px;font-weight:750;margin:0 0 13px}
.planner-table-scroll{overflow-x:auto;background:var(--panel);border:1px solid var(--line);border-radius:14px}
.planner-table{width:100%;border-collapse:collapse;text-align:left;font-size:13px;white-space:nowrap}
.planner-table th{color:#b0c1d5;background:var(--table-head);font-size:11px;letter-spacing:.3px;font-weight:750}
.planner-table th,.planner-table td{padding:12px 14px;border-bottom:1px solid rgba(255,255,255,.07)}
.planner-table tbody tr:last-child td{border-bottom:0}
.planner-table tbody tr:hover{background:rgba(255,255,255,.025)}
.planner-table td:first-child{color:#fff;font-weight:700}
.planner-num{font-variant-numeric:tabular-nums}
.planner-empty{padding:25px;background:var(--panel);border:1px solid var(--line);border-radius:14px;color:#a8b8c8;font-size:14px}
.planner-empty p{margin-bottom:0}
.planner-note{padding:14px 18px;border-left:2px solid #4a6687;background:rgba(87,110,139,.1);color:#9fb2c9;font-size:13px;line-height:1.6;border-radius:4px}
.planner-tools{display:flex;gap:10px;margin:10px 0 20px;flex-wrap:wrap}
.planner-tools input,.planner-tools select,.planner-simple-button{color:#fff;background:var(--surface);border:1px solid var(--line);padding:12px;border-radius:10px;font-size:14px}
.planner-tools input[type=search]{min-width:260px;flex:1}
.planner-timeline-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.planner-timeline{display:grid;grid-template-columns:175px repeat(7,minmax(130px,1fr));min-width:1100px}
.planner-timeline-head{padding:13px 10px;background:var(--table-head);color:#b4c3d4;font-size:12px;font-weight:750;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.planner-timeline-code{padding:13px 10px;font-size:12px;font-weight:750;border-bottom:1px solid var(--line);border-right:1px solid var(--line)}
.planner-timeline-cell{min-height:55px;padding:6px;border-bottom:1px solid var(--line);border-right:1px solid var(--line)}
.planner-timeline-chip{font-size:11px;border-radius:7px;padding:8px;background:#164c83;color:#e7f3ff;margin-bottom:4px;white-space:nowrap}
.planner-error{color:#ff9595}
@media(max-width:800px){
  body.planner-open .app-main{padding:15px}
  .planner-view{display:block}
  .planner-sidebar{position:static;margin-bottom:18px;padding:15px}
  .planner-sidebar-title{padding-bottom:12px}
  .planner-nav{display:flex;overflow-x:auto;gap:5px}
  .planner-nav-item{flex:0 0 auto;width:auto;white-space:nowrap;padding:11px}
  .planner-sidebar-foot{display:none}
  .planner-metrics{gap:8px}
  .planner-metric{padding:12px}
  .planner-metric strong{font-size:20px}
  .planner-title{font-size:25px}
}


/* Planner Dashboard: compact, content-width WO table and one warehouse group at a time. */
.planner-dashboard-tools{margin:0 0 15px}
.planner-dashboard-warehouses{display:inline-flex}
.planner-dashboard-warehouses .planner-simple-button{padding:8px 13px;font-size:12px}
.planner-dashboard-group{margin:0}
.planner-dashboard-group h2{font-size:15px;margin:0 0 10px}
.planner-dashboard .planner-table-scroll{
  display:block;
  width:max-content;
  max-width:100%;
  border-radius:10px;
}
.planner-dashboard .planner-table{
  width:max-content;
  min-width:0;
  table-layout:auto;
  font-family:"Segoe UI",Arial,sans-serif;
  font-size:12px;
  font-weight:400;
  letter-spacing:0;
  font-variant-numeric:tabular-nums;
}
.planner-dashboard .planner-table th,
.planner-dashboard .planner-table td{padding:6px 10px}
.planner-dashboard .planner-table th{font-weight:650;letter-spacing:0;font-size:11px}
.planner-dashboard .planner-table td:first-child{
  font-weight:500;
  color:#e7edf7;
  max-width:210px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.planner-dashboard .planner-table th:nth-child(2),
.planner-dashboard .planner-table th:nth-child(3),
.planner-dashboard .planner-table th:nth-child(4),
.planner-dashboard .planner-table td:nth-child(2),
.planner-dashboard .planner-table td:nth-child(3),
.planner-dashboard .planner-table td:nth-child(4){text-align:right}
.planner-dashboard .planner-table td:last-child{font-weight:450;color:#dae5f2}
.planner-sidebar-state-ok{color:#89e6b6}
.planner-sidebar-state-error{color:#ff9797}
.planner-sidebar-state-updating{color:#f2d58c}
.planner-sidebar-state-idle{color:var(--muted)}

/* Planner Stock: same compact typography as Work Orders, server-paginated. */
.planner-stock-tools{max-width:930px}
.planner-stock-count{font-size:12px;color:#9eafc2;margin:-6px 0 10px}
.planner-stock-table-wrap{width:min(100%,1050px)}
.planner-stock-table{min-width:760px;width:100%;table-layout:fixed;font:400 13px/1.4 "Segoe UI",Arial,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:0}
.planner-stock-table th,.planner-stock-table td{padding:9px 12px}
.planner-stock-table th{font-size:12px;letter-spacing:0;font-weight:650}
.planner-stock-table th:nth-child(1){width:18%}
.planner-stock-table th:nth-child(2){width:43%}
.planner-stock-table th:nth-child(3){width:7%}
.planner-stock-table th:nth-child(4){width:16%}
.planner-stock-table th:nth-child(5){width:16%}
.planner-stock-table td:first-child{font-weight:500;color:#e4eaf4}
.planner-stock-table td:nth-child(2){white-space:normal;overflow-wrap:anywhere;color:#c1ccdb}
.planner-stock-table th:nth-child(4),.planner-stock-table th:nth-child(5),.planner-stock-table td:nth-child(4),.planner-stock-table td:nth-child(5){text-align:right}
.planner-stock-pages{display:flex;align-items:center;gap:16px;margin:15px 0 22px}
.planner-stock-pages .planner-muted{margin:0;font-size:12px}
.planner-stock-pages .planner-simple-button{padding:8px 12px;font-size:12px}
.planner-stock-pages [disabled]{opacity:.45;cursor:default}

/* Stock multi-warehouse filter and sortable column headings */
.planner-stock-warehouse-choices{margin:0;padding:5px 9px;display:flex;align-items:center;gap:12px;
  border:1px solid var(--line);border-radius:9px;min-height:40px;flex-wrap:wrap}
.planner-stock-warehouse-choices legend{font-size:11px;color:#9daec1;padding:0 5px}
.planner-stock-warehouse-choice{display:inline-flex;align-items:center;gap:5px;color:#e0e9f5;font-size:13px;cursor:pointer;user-select:none}
.planner-stock-warehouse-choice input{accent-color:#65abeb;width:15px;height:15px;cursor:pointer}
.planner-stock-sort{font:inherit;font-weight:inherit;color:inherit;white-space:nowrap;border:0;background:transparent;
  cursor:pointer;display:inline-block;padding:3px 0;letter-spacing:0;text-align:inherit}
.planner-stock-sort:hover,.planner-stock-sort:focus-visible{color:#fff;text-decoration:underline;text-underline-offset:3px}
.planner-stock-table th[aria-sort=ascending] .planner-stock-sort,
.planner-stock-table th[aria-sort=descending] .planner-stock-sort{color:#9bd1ff}
/* Real count of transferred records; indeterminate while reading SQL */
.planner-sync-progress{margin:-7px 0 22px;max-width:640px;padding:12px 15px;border:1px solid var(--line);border-radius:12px}
.planner-sync-progress-stage{font-size:13px;color:#dfebf7;font-weight:600;margin-bottom:9px}
.planner-sync-progress-track{height:9px;border-radius:99px;overflow:hidden;background:#263447}
.planner-sync-progress-bar{height:100%;background:#4e9dda;border-radius:99px;transition:width .35s ease}
.planner-sync-progress-detail{font-size:11px;color:#99aec6;margin-top:7px}
.planner-sync-progress-indeterminate{height:9px;border-radius:99px;background:linear-gradient(90deg,#263447 0%,#4e9dda 50%,#263447 100%);background-size:200% 100%;animation:saldoissa-loading 1.6s ease-in-out infinite}
@keyframes saldoissa-loading{0%{background-position:100% 0}100%{background-position:-100% 0}}
@media (prefers-reduced-motion: reduce){.planner-sync-progress-indeterminate{animation:none}}


/* Planner v3: maximize horizontal schedule area without touching admin Production Plan. */
@media (min-width: 801px){
  body.planner-plan-fullscreen .app-main{
    width:100%;
    max-width:none;
    padding:12px 12px 34px;
  }
  body.planner-plan-fullscreen .planner-view{
    width:100%;
    grid-template-columns:58px minmax(0,1fr);
    gap:12px;
  }
  body.planner-plan-fullscreen .planner-sidebar{
    padding:10px 5px;
    border-radius:12px;
  }
  body.planner-plan-fullscreen .planner-sidebar-title,
  body.planner-plan-fullscreen .planner-sidebar-foot,
  body.planner-plan-fullscreen .planner-nav-item span{display:none}
  body.planner-plan-fullscreen .planner-nav-item{
    min-height:43px;
    justify-content:center;
    font-size:20px;
    padding:8px 4px;
    gap:0;
    text-align:center;
  }
  body.planner-plan-fullscreen .planner-topline{margin:0 0 10px}
}
body.planner-plan-fullscreen .planner-title{font-size:24px;margin-bottom:3px}
body.planner-plan-fullscreen .planner-muted{font-size:12px;margin-bottom:9px}
body.planner-plan-fullscreen .planner-source{font-size:11px;margin-bottom:10px}
body.planner-plan-fullscreen .planner-note{font-size:11px;line-height:1.4;padding:7px 10px;margin:4px 0 10px}
body.planner-plan-fullscreen .planner-tools{margin:6px 0 12px;gap:8px}
body.planner-plan-fullscreen .planner-tools input,
body.planner-plan-fullscreen .planner-simple-button{padding:7px 10px;font-size:12px;border-radius:7px}
body.planner-plan-fullscreen .planner-timeline-wrap{width:100%;border-radius:9px}
body.planner-plan-fullscreen .planner-timeline{
  width:100%;
  min-width:920px;
  grid-template-columns:minmax(146px,1.12fr) repeat(7,minmax(108px,1fr));
}
body.planner-plan-fullscreen .planner-timeline-head{
  padding:8px 5px;
  font-size:11px;
  text-align:center;
}
body.planner-plan-fullscreen .planner-timeline-head:first-child{text-align:left}
body.planner-plan-fullscreen .planner-timeline-code{
  padding:7px 7px;
  font-size:11px;
  overflow-wrap:anywhere;
}
body.planner-plan-fullscreen .planner-timeline-cell{min-height:31px;padding:3px}
body.planner-plan-fullscreen .planner-timeline-chip{
  margin:0 0 2px;
  padding:4px 5px;
  font-size:10px;
  line-height:1.25;
  border-radius:5px;
  white-space:normal;
  overflow-wrap:anywhere;
}
@media (max-width: 800px){
  body.planner-plan-fullscreen .app-main{width:100%;padding:10px 7px 28px}
  body.planner-plan-fullscreen .planner-sidebar{padding:8px;margin-bottom:9px}
  body.planner-plan-fullscreen .planner-topline{margin-bottom:9px}
  body.planner-plan-fullscreen .planner-timeline{min-width:920px}
}


/* Planner v4: one ISO calendar week per column in the read-only iScala plan. */
.planner-plan-tools{align-items:center}
.planner-plan-modes{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.planner-plan-modes .planner-simple-button{border:0;border-radius:0}
.planner-plan-modes .planner-simple-button + .planner-simple-button{border-left:1px solid var(--line)}
.planner-plan-modes .planner-simple-button.is-active{background:#205b93;color:#fff;font-weight:750}
.planner-plan-modes .planner-simple-button:focus-visible{outline:2px solid #8cc9ff;outline-offset:-2px}
.planner-plan-count{margin:0 0 7px!important}
.planner-timeline.planner-timeline--weeks{grid-template-columns:145px repeat(13,minmax(105px,1fr));min-width:1510px}
.planner-timeline--weeks .planner-timeline-head{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;white-space:nowrap}
.planner-timeline--weeks .planner-timeline-head:first-child{align-items:flex-start;text-align:left}
.planner-timeline--weeks .planner-timeline-head strong{font-size:11px;color:#e0ebf9}
.planner-timeline--weeks .planner-timeline-head small{font-size:10px;font-weight:500;color:#a1b5ca}
body.planner-plan-fullscreen .planner-timeline.planner-timeline--weeks{min-width:1510px;grid-template-columns:minmax(145px,1.1fr) repeat(13,minmax(105px,1fr))}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head{padding:7px 3px}
@media(max-width:800px){.planner-plan-modes{margin-left:0}}


/* Planner v5: visually separated warehouse groups, with optional focus filter. */
.planner-plan-warehouses{margin-left:auto}
.planner-timeline-group{grid-column:1/-1;display:flex;align-items:center;gap:12px;
  background:#24364b;color:#eff6ff;border-top:2px solid #6084a7;border-bottom:1px solid #40546d;
  padding:8px 10px;font-size:12px;line-height:1.3}
.planner-timeline-group--60{background:#293748;border-top-color:#c6a567}
.planner-timeline-group-count{color:#aebfd2;font-size:11px;font-weight:500}
.planner-timeline-empty{grid-column:1/-1;padding:9px 12px;color:#9bacc2;font-size:12px;
  border-bottom:1px solid var(--line)}
body.planner-plan-fullscreen .planner-timeline-group{padding:6px 9px}
@media(max-width:1050px){.planner-plan-warehouses{margin-left:0}}
@media(max-width:600px){.planner-plan-warehouses .planner-simple-button{padding:6px 7px}}


/* Planner calendar: uncluttered navigation and one-week-at-a-time travel. */
body.planner-plan-fullscreen .planner-topline{display:none}
body.planner-plan-fullscreen .planner-plan-tools{margin-top:0;margin-bottom:8px}
body.planner-plan-fullscreen .planner-plan-arrow{min-width:36px;font-size:18px;font-weight:750;line-height:1}
body.planner-plan-fullscreen .planner-plan-sync-info{font-size:11px;color:#83a5c7;white-space:nowrap}
body.planner-plan-fullscreen .planner-timeline-wrap:focus-visible{outline:2px solid #8cc9ff;outline-offset:2px}
body.planner-plan-fullscreen .planner-timeline-head--today{background:#24446a;color:#fff;box-shadow:inset 0 -3px 0 #78b7ef}
body.planner-plan-fullscreen .planner-timeline--days .planner-timeline-head:not(:first-child){white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:800px){body.planner-plan-fullscreen .planner-plan-sync-info{width:100%}}


/* Planner v6: two-dimensional scrolling for tall, wide production schedules. */
body.planner-plan-fullscreen .planner-timeline-wrap{
  height:max(260px, calc(100dvh - 180px));
  max-height:none;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
/* Keep dates visible when scrolling down and the item code when scrolling right. */
body.planner-plan-fullscreen .planner-timeline-head{
  position:sticky;
  top:0;
  z-index:5;
}
body.planner-plan-fullscreen .planner-timeline-code{
  position:sticky;
  left:0;
  z-index:3;
  background:var(--panel);
  box-shadow:2px 0 3px rgba(0,0,0,.18);
}
body.planner-plan-fullscreen .planner-timeline-head:first-child{
  left:0;
  z-index:7;
}
/* The warehouse heading remains readable while moving horizontally. */
body.planner-plan-fullscreen .planner-timeline-group > strong{
  position:sticky;
  left:9px;
}
@media(max-width:800px){
  body.planner-plan-fullscreen .planner-timeline-wrap{
    height:max(260px, calc(100dvh - 235px));
  }
}

/* Started iScala WOs: calm blue-green teal, visually distinct from the
   separate dark-green/full and light-green/partial material-issue pixels. */
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--started{
  background:#266f78;
  color:#f4fcfc;
  font-weight:700;
  box-shadow:inset 0 0 0 1px #519ca6;
}


/* Planner v8: narrow calendar columns, subtle click-to-track row selection. */
body.planner-plan-fullscreen .planner-timeline-head{
  padding:6px 3px;
  font-size:10.5px;
}
body.planner-plan-fullscreen .planner-timeline-cell{
  min-height:32px;
  padding:2px;
}
body.planner-plan-fullscreen .planner-timeline-chip{
  padding:4px 3px;
  font-size:10px;
  line-height:1.25;
  margin-bottom:2px;
}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code{
  display:block;
  min-width:0;
  padding:6px 7px;
  border-top:0;
  border-left:0;
  border-radius:0;
  text-align:left;
  font:650 11px/1.35 "Segoe UI",Arial,sans-serif;
  color:#e6edf7;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code:hover{
  background:#1d2c40;
}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code:focus-visible{
  outline:2px solid #8cc9ff;
  outline-offset:-2px;
}
body.planner-plan-fullscreen .planner-timeline-cell.planner-timeline-row--selected{
  background:rgba(117,160,205,.105);
  box-shadow:inset 0 1px 0 rgba(145,186,228,.42),
             inset 0 -1px 0 rgba(145,186,228,.42);
}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code.planner-timeline-row--selected{
  background:#24394f;
  color:#f3f8ff;
  box-shadow:inset 3px 0 0 #9ac3e8,
             inset 0 1px 0 rgba(145,186,228,.42),
             inset 0 -1px 0 rgba(145,186,228,.42);
}
/* Row selection belongs to cells; started WO chips retain their teal state color. */


/* Planner v9: one-line WO number, planned quantity and remaining quantity.
   Empty date columns stay narrow; occupied ones expand just enough to fit. */
body.planner-plan-fullscreen .planner-timeline-chip{
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:normal;
  font-variant-numeric:tabular-nums;
  padding:4px 5px;
}


/* Legacy warehouse-label styles (neutralized below by the material-pixel rules).
   They must not override started-teal or ordinary-blue WO chip backgrounds. */
body.planner-plan-fullscreen .planner-timeline-chip {
  display:flex;
  align-items:center;
  width:max-content;
  gap:5px;
}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh {
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  justify-content:center;
  border-radius:4px;
  padding:1px 4px;
  line-height:1.2;
  font-size:9.5px;
  font-weight:750;
  background:rgba(255,255,255,.10);
  color:inherit;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--all {
  background:#237b47;
  color:#fff;
  box-shadow:inset 0 0 0 1px #176037;
}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--partial {
  background:#bfe8c9;
  color:#184f30;
  box-shadow:inset 0 0 0 1px #8bc69b;
}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-chip-text {
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

/* WO BOM availability: shortage only affects the small warehouse label. */
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--shortage {
  background:#ba3540;
  color:#ffffff;
  border:1px solid #e66b70;
  font-weight:750;
}


/* Customer Orders v12 — same spacious two-axis week planner, no warehouse split. */
body.planner-plan-fullscreen .planner-co-tools .planner-co-caption {
  color:#92abc7;font:500 11px/1.3 "Segoe UI",Arial,sans-serif;
  margin-left:auto;white-space:nowrap;
}
body.planner-plan-fullscreen .planner-co-timeline .planner-timeline-cell {
  min-height:32px;
}
body.planner-plan-fullscreen .planner-co-timeline .planner-co-chip {
  display:flex;
  align-items:center;
  width:max-content;
  max-width:none;
  background:#17518d;
  color:#e9f5ff;
  border:1px solid #3979b4;
  box-shadow:none;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  padding:4px 6px;
  margin:0 0 2px;
  font:600 10px/1.3 "Segoe UI",Arial,sans-serif;
}
body.planner-plan-fullscreen .planner-co-loading {padding:24px 12px;color:#9bb4cd;font-size:13px}
@media(max-width:800px){
 body.planner-plan-fullscreen .planner-co-tools .planner-co-caption{margin-left:0;width:100%;}
}


/* v19: delivery risk is indicated by a red ! only, without a red chip outline. */
body.planner-plan-fullscreen .planner-timeline-delivery-warning {
  flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;border-radius:50%;
  background:#ba3440;color:#fff;font-size:10px;font-weight:800;
  line-height:1;box-shadow:0 0 0 1px rgba(255,255,255,.5);
}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code--delivery-risk::after {
  display:inline-block;content:'!';margin-left:6px;
  border-radius:50%;background:#bd4351;color:#fff;
  width:14px;height:14px;line-height:14px;text-align:center;
  font:800 10px/14px 'Segoe UI',Arial,sans-serif;
}
body.planner-plan-fullscreen .planner-delivery-risk-summary {
  position:relative;margin-left:auto;color:#ffc3c7;font-size:11px;
  z-index:12;
}
body.planner-plan-fullscreen .planner-delivery-risk-summary summary {
  cursor:pointer;list-style:revert;white-space:nowrap;
}
body.planner-plan-fullscreen .planner-delivery-risk-list {
  position:absolute;right:0;top:calc(100% + 8px);
  width:min(370px,80vw);max-height:260px;overflow:auto;
  padding:7px 12px;background:#17283c;color:#ecf0f7;
  border:1px solid #486077;border-radius:7px;
  box-shadow:0 10px 25px rgba(0,0,0,.35);line-height:1.65;
}
body.planner-plan-fullscreen .planner-delivery-risk-list>div {
  border-bottom:1px solid rgba(255,255,255,.09);padding:3px 0;
}


/* v15: one space-saving display-settings control for production-plan cards.
   Preferences never hide the real order/warehouse from the accessible tooltip. */
body.planner-plan-fullscreen .planner-plan-display ,
.planner-orders-display {
  position:relative;
  z-index:16;
  flex:0 0 auto;
  line-height:1;
}
body.planner-plan-fullscreen .planner-plan-display-trigger ,
.planner-orders-display-trigger {
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:32px;
  padding:0;
  color:#b5c8dd;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  cursor:pointer;
  list-style:none;
  transition:background .14s,border-color .14s,color .14s;
}
body.planner-plan-fullscreen .planner-plan-display-trigger::-webkit-details-marker ,
.planner-orders-display-trigger::-webkit-details-marker {display:none}
body.planner-plan-fullscreen .planner-plan-display-trigger:hover,
.planner-orders-display-trigger:hover,
body.planner-plan-fullscreen .planner-plan-display[open] .planner-plan-display-trigger ,
.planner-orders-display[open] .planner-orders-display-trigger {
  color:#fff;
  border-color:#5383b4;
  background:#1b314a;
}
body.planner-plan-fullscreen .planner-plan-display.is-customized .planner-plan-display-trigger ,
.planner-orders-display.is-customized .planner-orders-display-trigger {
  color:#b8dfff;
  border-color:#386b9d;
}
body.planner-plan-fullscreen .planner-plan-display-trigger:focus-visible ,
.planner-orders-display-trigger:focus-visible {
  outline:2px solid #8cc9ff;
  outline-offset:2px;
}
body.planner-plan-fullscreen .planner-plan-display-menu ,
.planner-orders-display-menu {
  position:absolute;
  right:0;
  top:calc(100% + 7px);
  width:188px;
  padding:10px;
  color:#e5effb;
  background:#192a3d;
  border:1px solid #425a74;
  border-radius:10px;
  box-shadow:0 12px 28px rgba(0,0,0,.35);
}
body.planner-plan-fullscreen .planner-plan-display-title ,
.planner-orders-display-title {
  margin:0 3px 7px;
  color:#9db4ce;
  font:600 10px/1.3 'Segoe UI',Arial,sans-serif;
  letter-spacing:.025em;
}
body.planner-plan-fullscreen .planner-plan-display-option ,
.planner-orders-display-option {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:33px;
  padding:4px 5px;
  border-radius:6px;
  cursor:pointer;
  font:500 12px/1.3 'Segoe UI',Arial,sans-serif;
}
body.planner-plan-fullscreen .planner-plan-display-option:hover ,
.planner-orders-display-option:hover {background:rgba(160,194,231,.09)}
body.planner-plan-fullscreen .planner-plan-display-option input[type='checkbox'] ,
.planner-orders-display-option input[type='checkbox'] {
  appearance:none;
  -webkit-appearance:none;
  flex:0 0 28px;
  width:28px;
  height:16px;
  margin:0;
  padding:0;
  position:relative;
  background:#53647a;
  border:1px solid #627489;
  border-radius:999px;
  cursor:pointer;
  transition:background .15s;
}
body.planner-plan-fullscreen .planner-plan-display-option input[type='checkbox']::before ,
.planner-orders-display-option input[type='checkbox']::before {
  content:'';
  display:block;
  position:absolute;
  width:10px;
  height:10px;
  top:2px;
  left:2px;
  background:#fff;
  border-radius:50%;
  box-shadow:0 1px 2px rgba(0,0,0,.22);
  transition:transform .15s;
}
body.planner-plan-fullscreen .planner-plan-display-option input[type='checkbox']:checked ,
.planner-orders-display-option input[type='checkbox']:checked {
  background:#2674b4;
  border-color:#418bd2;
}
body.planner-plan-fullscreen .planner-plan-display-option input[type='checkbox']:checked::before ,
.planner-orders-display-option input[type='checkbox']:checked::before {
  transform:translateX(12px);
}
body.planner-plan-fullscreen .planner-plan-display-option input[type='checkbox']:focus-visible ,
.planner-orders-display-option input[type='checkbox']:focus-visible {
  outline:2px solid #8cc9ff;
  outline-offset:3px;
}


/* Planner v18: distinct compact controls for Days / Weeks and warehouse groups. */
body.planner-plan-fullscreen .planner-plan-tools .planner-plan-modes{
  gap:5px;
  border:0;
  border-radius:0;
  overflow:visible;
}
body.planner-plan-fullscreen .planner-plan-tools .planner-plan-modes .planner-simple-button{
  border:1px solid var(--line);
  border-radius:7px;
}
body.planner-plan-fullscreen .planner-plan-tools .planner-plan-modes .planner-simple-button + .planner-simple-button{
  border-left:1px solid var(--line);
}


/* Planner v19: small weekly-total switch and a neutral summed quantity chip. */
body.planner-plan-fullscreen .planner-plan-total-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:31px;
  min-width:31px;
  height:31px;
  padding:0;
  border:1px solid #3e6383;
  border-radius:7px;
  background:#101e31;
  color:#d4e5f7;
  font:400 18px/1 'Segoe UI',Arial,sans-serif;
}
body.planner-plan-fullscreen .planner-plan-total-button:hover{
  background:#1a3653;
  border-color:#739fc5;
}
body.planner-plan-fullscreen .planner-plan-total-button.is-active{
  background:#205b93;
  border-color:#4d9cdd;
  color:#ffffff;
}
body.planner-plan-fullscreen .planner-plan-total-button:focus-visible{
  outline:2px solid #9fd3ff;
  outline-offset:2px;
}
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total{
  background:#284c69;
  color:#f2f7fd;
  border:1px solid #53799b;
  font-weight:750;
  box-shadow:none;
}


/* Planner v20: calm week headers in Production Plan and Customer Orders. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child){
  font-family:'Segoe UI',Arial,sans-serif;
  font-weight:500;
  color:#9aafc5;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) strong{
  font-size:11px;
  line-height:1.3;
  font-weight:550;
  letter-spacing:.005em;
  color:#afc1d4;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) small{
  color:#869db6;
  font-size:10px;
  font-weight:400;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child){
  background:#203b58;
  box-shadow:inset 0 -2px 0 #6597c2;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) strong{
  color:#d8e6f5;
  font-weight:650;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) small{
  color:#b5c8db;
}
/* Customer order totals share the compact Σ style with the production plan. */
body.planner-plan-fullscreen .planner-co-chip.planner-timeline-chip--total{
  background:#284c69;
  color:#f2f7fd;
  border-color:#53799b;
  font-weight:700;
}


/* Planner v22: unified compact shell. Only cosmetic changes. */
.app-header{
  min-height:52px;
  padding:5px max(12px,env(safe-area-inset-right)) 5px max(12px,env(safe-area-inset-left));
  gap:12px;
}
.app-header .brand-logo{width:31px;height:31px}
.app-header .brand-button{font-size:17px;gap:8px}
.header-right{gap:10px}
.header-session-actions{display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:0}
.header-session-actions .header-action{min-height:29px;padding:0 10px;border-radius:8px;font-size:10px;letter-spacing:.2px}
.planner-header-readonly{
  display:none;flex:0 0 auto;border:1px solid #324c69;border-radius:99px;
  padding:4px 8px;color:#a2bbd5;font-size:9px;font-weight:700;letter-spacing:.8px;
}
.planner-header-last-import{
  display:none;white-space:nowrap;font-size:10px;line-height:1.2;
  color:#8fa8c1;font-weight:400;font-variant-numeric:tabular-nums;
}
body.planner-open .planner-header-readonly{display:inline-flex}
body.planner-open .planner-header-last-import{display:block}
body.planner-open .app-main{padding-top:15px}
body.planner-open .planner-sidebar{top:66px;padding-top:12px}
body.planner-open .planner-topline{margin:0 0 15px;justify-content:flex-start}
body.planner-open .planner-nav-item{gap:0;padding:12px 13px}
.planner-nav-glyph{display:none}
.planner-nav-label{display:inline;min-width:0}
.planner-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(min-width:801px){
  body.planner-plan-fullscreen .planner-sidebar{top:65px;padding:10px 5px}
  body.planner-plan-fullscreen .planner-nav-item{padding:8px 2px;gap:0}
  body.planner-plan-fullscreen .planner-nav-label{display:none}
  body.planner-plan-fullscreen .planner-nav-item .planner-nav-glyph{
    display:block;flex:0 0 auto;text-align:center;
    width:100%;font-size:11px;line-height:1.25;font-weight:750;
    letter-spacing:0;white-space:nowrap;
  }
  body.planner-plan-fullscreen .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph,
  body.planner-plan-fullscreen .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph{font-size:20px;font-weight:500}
}
@media(max-width:800px){
  body.planner-open .planner-sidebar{padding:9px;top:auto}
  body.planner-open .planner-nav-item{padding:8px 10px}
  .header-right .user-name{font-size:11px}
}
@media(max-width:560px){
  .app-header .brand-button{font-size:14px;gap:6px}
  .app-header .brand-logo{width:28px;height:28px}
  .planner-header-readonly{padding:3px 5px;font-size:8px;letter-spacing:.25px}
  .planner-header-last-import{font-size:9px}
  .app-header{gap:6px}
}

body.planner-plan-fullscreen .planner-topline{display:flex;margin:0 0 7px;font-size:11px}

/* User name and logout share the same row. The wide import timestamp must not
   determine the distance between them: position it underneath the logout. */
.header-right{position:relative;gap:5px}
body.planner-open .app-header{min-height:62px}
body.planner-open .header-session-actions{flex:0 0 auto}
body.planner-open .planner-header-last-import{
  position:absolute;
  right:0;
  top:calc(100% + 2px);
  width:max-content;
  max-width:none;
  margin:0;
}
.header-brand-group{display:flex;align-items:center;gap:14px;min-width:0}
@media(max-width:560px){.header-brand-group{gap:7px}}

/* Dashboard Σ uses the same compact, light-weight control as Production Plan. */
.planner-dashboard-tools{align-items:center}
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:29px;
  min-width:29px;
  height:29px;
  padding:0;
  border:1px solid #3e6383;
  border-radius:7px;
  background:#101e31;
  color:#d4e5f7;
  font:400 18px/1 "Segoe UI",Arial,sans-serif;
}
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button:hover{
  background:#1a3653;
  border-color:#739fc5;
}
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button.is-active{
  background:#205b93;
  border-color:#4d9cdd;
  color:#fff;
}
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button:focus-visible{
  outline:2px solid #9fd3ff;
  outline-offset:2px;
}
.planner-dashboard .planner-dashboard-total-row td:last-child{text-align:right}


/* Production Plan / Customer Orders: sort stock-code rows by week order count. */
body.planner-plan-fullscreen .planner-week-heading-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  width:100%;
}
body.planner-plan-fullscreen .planner-week-sort{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:19px;
  padding:0;
  border:1px solid transparent;
  border-radius:4px;
  color:#8198b0;
  background:transparent;
  font:400 16px/1 'Segoe UI',Arial,sans-serif;
  cursor:pointer;
  flex:0 0 auto;
}
body.planner-plan-fullscreen .planner-week-sort:hover{
  color:#fff;
  background:#2b4764;
}
body.planner-plan-fullscreen .planner-week-sort.is-active{
  color:#fff;
  background:#225c95;
  border-color:#579bd7;
}
body.planner-plan-fullscreen .planner-week-sort:focus-visible{
  outline:2px solid #a6d9ff;
  outline-offset:1px;
}


/* Saldoissa readability system: restrained dark theme, optional light theme,
   consistent focus rings, and independent compact / comfortable tables. */
:root{font-synthesis:none;text-rendering:optimizeLegibility}
html{font-size:16px}
body{line-height:1.45;font-size:14px}
button,select,input{font-family:inherit}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,
summary:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--focus-ring);outline-offset:2px
}
.planner-num,.planner-timeline-chip,.planner-table,.planner-stock-table,
.production-plan-grid,.commercial-order-line,.order-card-progress,
.planner-header-last-import{font-variant-numeric:tabular-nums}

/* Shared surfaces, search, tables and interactive affordances. */
.app-header{background:var(--header-bg)}
.app-header .brand-button{color:var(--text)}
.header-action,.icon-button,.back-button{background:var(--surface);color:var(--text)}
.header-action:hover,.icon-button:hover,.back-button:hover{background:var(--surface-raised)}
.field input,.field select,.search-field input,.ready-input,.production-plan-date-field input{
  background:var(--input-bg);color:var(--text)}
.modal-sheet{background:var(--panel)}
.operation-list button{background:var(--surface);color:var(--text)}
.operation-list button.selected{background:var(--surface-raised)}
.toast{background:var(--panel2);color:var(--text)}
.secondary-button,.operation-button{background:var(--surface-raised);color:var(--text)}
.small-action-button,.bom-create-link{background:var(--surface-raised);color:var(--text)}
.admin-menu-row,.admin-user-row{color:var(--text)}
.order-card{color:var(--text)}
.order-card-number,.users-create-title{font-weight:700}
.order-card-code{font-size:14px}
.planner-sidebar{background:var(--panel)}
.planner-nav-item{color:var(--muted);font-weight:550}
.planner-nav-item.is-active,.planner-nav-item:hover{
  background:rgba(77,135,196,.19);color:var(--text)}
.planner-topline,.planner-header-last-import,.planner-source{color:var(--muted)}
.planner-title{font-weight:700;letter-spacing:-.45px}
.planner-group h2{font-weight:650}
.planner-table-scroll,.planner-timeline-wrap{background:var(--panel)}
.planner-table{font-size:13px;font-family:Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif}
.planner-table th{background:var(--table-head);color:var(--muted);font-size:12px;font-weight:650}
.planner-table th,.planner-table td{border-bottom:1px solid var(--line)}
.planner-table tbody tr:hover{background:var(--hover-bg)}
.planner-table td:first-child{color:var(--text);font-weight:600}
.planner-dashboard .planner-table{font-family:inherit;font-size:13px}
.planner-dashboard .planner-table th{font-size:12px;font-weight:650}
.planner-dashboard .planner-table td:first-child{font-weight:550;color:var(--text)}
.planner-dashboard .planner-table td:last-child{color:var(--muted)}
.planner-dashboard .planner-table th,.planner-dashboard .planner-table td{padding:7px 10px}
.planner-dashboard .planner-table td:nth-child(2),
.planner-dashboard .planner-table td:nth-child(3),
.planner-dashboard .planner-table td:nth-child(4){font-variant-numeric:tabular-nums}
.planner-table tbody tr:nth-child(even){background:rgba(142,172,204,.035)}
.planner-table tbody tr:nth-child(even):hover{background:var(--hover-bg)}
.planner-stock-table{font:400 13px/1.45 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif}
.planner-stock-table th{font-size:12px}
.planner-stock-table td:first-child{color:var(--text)}
.planner-stock-table td:nth-child(2){color:var(--muted)}
.planner-stock-warehouse-choice{color:var(--text)}
.planner-stock-sort:hover,.planner-stock-sort:focus-visible{color:var(--text)}
.planner-tools input,.planner-tools select,.planner-simple-button{
  color:var(--text);background:var(--surface);font-family:inherit}
.planner-simple-button:hover:not(:disabled){background:var(--surface-raised)}
.planner-plan-modes .planner-simple-button.is-active{color:#fff}
.planner-readonly{color:var(--muted);border-color:var(--line)}
.planner-note{color:var(--muted)}
.planner-timeline-head{background:var(--table-head);color:var(--muted)}
.planner-timeline-code{color:var(--text);background:var(--panel)}
.planner-timeline-cell{background:var(--table-cell)}
.planner-timeline--weeks .planner-timeline-head strong{color:var(--text);font-size:12px}
.planner-timeline--weeks .planner-timeline-head small{color:var(--muted);font-size:11px}
body.planner-plan-fullscreen .planner-timeline-head{background:var(--table-head);color:var(--muted)}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code{
  font:600 13px/1.4 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  color:var(--text);background:var(--panel)}
body.planner-plan-fullscreen :is(button,div).planner-timeline-code:hover{background:var(--surface-raised)}
body.planner-plan-fullscreen .planner-timeline-cell{background:var(--table-cell)}
body.planner-plan-fullscreen .planner-timeline-chip{
  font-family:Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  font-size:11.5px;line-height:1.35;font-weight:550;padding:5px 6px}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh{
  font-size:11px;font-weight:650}
body.planner-plan-fullscreen .planner-co-timeline .planner-co-chip{
  font:550 11.5px/1.35 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  padding:5px 6px}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) strong{
  font-size:12px;font-weight:600;color:var(--text)}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) small{
  font-size:11px;font-weight:450;color:var(--muted)}
body.planner-plan-fullscreen .planner-week-sort{color:var(--muted)}
body.planner-plan-fullscreen .planner-plan-display-trigger,
.planner-orders-display-trigger{background:var(--surface);color:var(--text)}
body.planner-plan-fullscreen .planner-plan-display-menu,
.planner-orders-display-menu{
  background:var(--panel2);color:var(--text);border-color:var(--line)}
body.planner-plan-fullscreen .planner-plan-display-title,
.planner-orders-display-title{color:var(--muted)}
body.planner-plan-fullscreen .planner-plan-total-button,
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button{
  background:var(--surface);color:var(--text);font-weight:400}
body.planner-plan-fullscreen .planner-plan-total-button.is-active,
.planner-dashboard .planner-dashboard-tools .planner-plan-total-button.is-active{color:#fff}
body.planner-plan-fullscreen .planner-timeline-head--today{
  background:#29496c;color:#e8eff8;box-shadow:inset 0 -2px 0 #76b3e9}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child){
  background:#29496c;box-shadow:inset 0 -2px 0 #76b3e9}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) strong{
  color:#e8eff8}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) small{
  color:#bfd4ec}
body.planner-plan-fullscreen .planner-timeline-group{background:#283a50}
body.planner-plan-fullscreen .planner-timeline-group--60{background:#303a4b}
body.planner-plan-fullscreen .planner-timeline-group-count{color:var(--muted)}
body.planner-plan-fullscreen .planner-plan-sync-info,
body.planner-plan-fullscreen .planner-co-tools .planner-co-caption{color:var(--muted)}
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--started{
  background:#266f78;color:#f4fcfc;font-weight:650;box-shadow:inset 0 0 0 1px #519ca6}
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--started .planner-timeline-wh{
  color:inherit}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--all{color:#fff}
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--shortage{color:#fff}
.production-plan-screen:not([hidden]){background:var(--bg)}
.production-plan-scroll,.production-plan-date-cell,.production-plan-background-cell{background:var(--table-cell)}
.production-plan-code{background:var(--panel);color:var(--text)}
.production-plan-header,.production-plan-date-header{background:var(--table-head);color:var(--muted)}
.production-plan-order strong{font-size:16px}
.production-plan-order small{font-size:11px}

/* Comfortable mode grows cells and label sizes without changing data or filtering. */
html[data-density="comfortable"] .planner-dashboard .planner-table th,
html[data-density="comfortable"] .planner-dashboard .planner-table td{padding:10px 13px;font-size:14px}
html[data-density="comfortable"] .planner-stock-table th,
html[data-density="comfortable"] .planner-stock-table td{padding:12px 14px;font-size:14px}
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-timeline-cell{min-height:40px;padding:4px}
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-timeline-head{padding:9px 5px}
html[data-density="comfortable"] body.planner-plan-fullscreen :is(button,div).planner-timeline-code{
  font-size:14px;padding:9px}
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-timeline-chip,
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-co-timeline .planner-co-chip{
  font-size:13px;padding:7px 8px;line-height:1.4}
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh{font-size:12px}
html[data-density="comfortable"] .planner-table:not(.planner-stock-table) th,
html[data-density="comfortable"] .planner-table:not(.planner-stock-table) td{line-height:1.5}

/* Light option: preserve status semantics and chromatic hierarchy,
   but use an off-white canvas and darker table/secondary text. */
html[data-theme="light"]{
  --bg:#f3f6fa;--panel:#ffffff;--panel2:#edf3fa;
  --line:#d8e1ec;--text:#1f2937;--muted:#4b6078;
  --blue:#2366af;--surface:#f4f7fb;--surface-raised:#e7eef6;
  --input-bg:#fff;--table-head:#eaf0f7;--table-cell:#f9fbfe;
  --header-bg:rgba(249,251,254,.97);--hover-bg:#eaf3fd;--focus-ring:#2366af;
  color-scheme:light;
}
html[data-theme="light"] .brand-name{color:var(--text)}
html[data-theme="light"] .primary-button{color:#fff}
html[data-theme="light"] .primary-button:disabled{background:#d1dce8;color:#637487}
html[data-theme="light"] .operation-button.operation-needed,
html[data-theme="light"] .timer-button.start,
html[data-theme="light"] .timer-button.restart,
html[data-theme="light"] .timer-button.stop{color:#fff}
html[data-theme="light"] .empty-state strong,
html[data-theme="light"] .order-card,
html[data-theme="light"] .admin-menu-row{color:var(--text)}
html[data-theme="light"] .modal{background:rgba(31,41,55,.4)}
html[data-theme="light"] .form-message.success,
html[data-theme="light"] .lookup-status.found{color:#176a3b}
html[data-theme="light"] .form-message.error,
html[data-theme="light"] .lookup-status.missing{color:#aa2634}
html[data-theme="light"] .planner-nav-item{color:var(--muted)}
html[data-theme="light"] .planner-nav-item.is-active,
html[data-theme="light"] .planner-nav-item:hover{background:#e3effc;color:#174c81}
html[data-theme="light"] .planner-sidebar-state-ok{color:#166b3b}
html[data-theme="light"] .planner-sidebar-state-error{color:#b02534}
html[data-theme="light"] .planner-sidebar-state-updating{color:#825900}
html[data-theme="light"] .planner-header-readonly{color:#335e86;border-color:#acbed0}
html[data-theme="light"] .planner-dashboard .planner-table td:first-child,
html[data-theme="light"] .planner-dashboard .planner-table td:last-child,
html[data-theme="light"] .planner-stock-table td:first-child{color:var(--text)}
html[data-theme="light"] .planner-table tbody tr:nth-child(even){background:#f4f8fd}
html[data-theme="light"] .planner-table tbody tr:hover,
html[data-theme="light"] .planner-table tbody tr:nth-child(even):hover{background:#eaf3fd}
html[data-theme="light"] .planner-readonly{color:#285b91}
html[data-theme="light"] .planner-empty,
html[data-theme="light"] .planner-note{color:var(--muted)}
html[data-theme="light"] .planner-stock-count,
html[data-theme="light"] .planner-stock-warehouse-choices legend{color:var(--muted)}
html[data-theme="light"] .planner-stock-sort:hover{color:#1b538b}
html[data-theme="light"] .planner-stock-table th[aria-sort=ascending] .planner-stock-sort,
html[data-theme="light"] .planner-stock-table th[aria-sort=descending] .planner-stock-sort{color:#1a5d9f}
html[data-theme="light"] .planner-plan-modes .planner-simple-button.is-active,
html[data-theme="light"] .planner-plan-warehouses .planner-simple-button.is-active,
html[data-theme="light"] .planner-plan-total-button.is-active{color:#fff}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-head--today,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child){
  background:#d5e8fa;color:#174c81;box-shadow:inset 0 -2px 0 #3c7db6}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) strong{color:#174c81}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) small{color:#355b80}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-group{
  background:#dbe8f5;color:#284869;border-top-color:#86a9ce;border-bottom-color:#c4d6e9}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-group--60{
  background:#edf0e5;color:#3c5138;border-top-color:#9caa86}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip{
  background:#dcecff;color:#154e7c;box-shadow:inset 0 0 0 1px #a5c9eb}
html[data-theme="light"] body.planner-plan-fullscreen .planner-co-timeline .planner-co-chip{
  background:#deecfb;color:#174c7b;border:1px solid #9dbfdf;box-shadow:none}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--started{
  background:#b6dee2;color:#184850;box-shadow:inset 0 0 0 1px #74b4bb}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh{
  background:#cbdced;color:#244968;box-shadow:inset 0 0 0 1px #9bb6cf}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--all{
  background:#247347;color:#fff;box-shadow:inset 0 0 0 1px #176037}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--partial{
  background:#d1eecf;color:#215b33;box-shadow:inset 0 0 0 1px #8fc495}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh--shortage{
  background:#b52f40;color:#fff;box-shadow:none}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total,
html[data-theme="light"] body.planner-plan-fullscreen .planner-co-chip.planner-timeline-chip--total{
  background:#d3e5f7;color:#173f67;border:1px solid #a0bddc;box-shadow:none}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-cell.planner-timeline-row--selected{
  background:#e9f3fd;box-shadow:inset 0 1px 0 #96bfdf,inset 0 -1px 0 #96bfdf}
html[data-theme="light"] body.planner-plan-fullscreen :is(button,div).planner-timeline-code.planner-timeline-row--selected{
  background:#d1e8fa;color:#174c81;box-shadow:inset 3px 0 0 #337bb8}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-delivery-warning,
html[data-theme="light"] body.planner-plan-fullscreen :is(button,div).planner-timeline-code--delivery-risk::after{color:#fff}
html[data-theme="light"] body.planner-plan-fullscreen .planner-delivery-risk-summary{color:#a72636}
html[data-theme="light"] body.planner-plan-fullscreen .planner-delivery-risk-list{
  background:#fff;color:#1f2937;border-color:#b9c8d7}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display-menu,
html[data-theme="light"] .planner-orders-display-menu{
  background:#fff;color:var(--text);border-color:var(--line)}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display-trigger,
html[data-theme="light"] .planner-orders-display-trigger,
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display-title,
html[data-theme="light"] .planner-orders-display-title{color:var(--muted)}
html[data-theme="light"] body.planner-plan-fullscreen .planner-week-sort:hover,
html[data-theme="light"] body.planner-plan-fullscreen .planner-week-sort.is-active{color:#fff}
html[data-theme="light"] .planner-dashboard .planner-dashboard-tools .planner-plan-total-button.is-active{color:#fff}
html[data-theme="light"] .production-plan-date-header.weekend,
html[data-theme="light"] .production-plan-background-cell.weekend{
  background:repeating-linear-gradient(-45deg,rgba(40,65,92,.035),rgba(40,65,92,.035) 7px,
              rgba(40,65,92,.07) 7px,rgba(40,65,92,.07) 14px),#eff3f8}
html[data-theme="light"] .production-plan-date-header.weekend small,
html[data-theme="light"] .production-plan-date-header.weekend strong{color:#526780}
html[data-theme="light"] .production-plan-order{background:#dcecff;border-color:#9cbfdf}
html[data-theme="light"] .production-plan-order strong{color:#173d61}
html[data-theme="light"] .production-plan-order small{color:#365673}
html[data-theme="light"] .production-plan-order-duration{color:#245c90}
html[data-theme="light"] .production-plan-order.missing-duration{background:#fff1d9;border-color:#a87529}
html[data-theme="light"] .production-plan-order.missing-duration .production-plan-order-duration{color:#775015}
html[data-theme="light"] .purchase-receipt-form{background:#f7fafd}
html[data-theme="light"] .stock-unit-display{background:#f6f9fc}

@media (prefers-reduced-motion:reduce){
  .planner-timeline-cell,.planner-timeline-code,.planner-simple-button{transition:none!important}
}

/* Complete the light palette for administrative editors and status messages. */
html[data-theme="light"] .card-label{color:var(--muted)}
html[data-theme="light"] .card-progress{color:var(--muted)}
html[data-theme="light"] .lookup-status.found,
html[data-theme="light"] .bom-row-status.found{color:#176a3b}
html[data-theme="light"] .lookup-status.missing,
html[data-theme="light"] .bom-row-status.missing,
html[data-theme="light"] .danger-button{color:#a32637}
html[data-theme="light"] .setup-message.success{color:#146b38}
html[data-theme="light"] .setup-message.error{color:#aa2634}
html[data-theme="light"] .form-message.error{color:#aa2634}
html[data-theme="light"] .purchase-receipt-form{background:#f7fafd}
html[data-theme="light"] .bom-row,
html[data-theme="light"] .routing-row,
html[data-theme="light"] .purchase-receipt-form{border-color:var(--line)}
html[data-theme="light"] .production-plan-date-cell.past{background:#f1f5fa}


/* Production Plan — optional material issue pixels, independent of warehouse label.
   Five pixels (dark green) = all issued; two lower, light-green pixels = partial.
   Pixels are categorical, NEVER an assumed percent issued. */
body.planner-plan-fullscreen .planner-plan-materials-button{
  display:inline-flex;align-items:center;justify-content:center;
  height:31px;min-height:31px;padding:0 10px;
  border:1px solid var(--line);border-radius:7px;
  background:var(--surface);color:var(--text);
  font:600 11px/1 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  letter-spacing:.035em;
}
body.planner-plan-fullscreen .planner-plan-materials-button:hover{
  background:var(--surface-raised);
}
body.planner-plan-fullscreen .planner-plan-materials-button.is-active{
  background:#205b93;border-color:#4d9cdd;color:#fff;
}
body.planner-plan-fullscreen .planner-plan-materials-button:focus-visible{
  outline:2px solid #9fd3ff;outline-offset:2px;
}
body.planner-plan-fullscreen .planner-material-order-row{
  display:flex;align-items:center;gap:5px;width:max-content;
  margin-bottom:2px;
}
body.planner-plan-fullscreen .planner-material-order-row > .planner-timeline-chip{
  margin-bottom:0;
}
body.planner-plan-fullscreen .planner-material-indicators{
  display:inline-flex;align-items:center;gap:3px;flex:0 0 auto;
}
body.planner-plan-fullscreen .planner-material-pixels{
  display:inline-grid;grid-template-rows:repeat(5,4px);row-gap:1px;
  width:7px;flex:0 0 7px;vertical-align:middle;
}
body.planner-plan-fullscreen .planner-material-pixel{
  display:block;width:7px;height:4px;border-radius:1px;
  background:rgba(142,169,194,.26);
}
body.planner-plan-fullscreen .planner-material-pixels--all .planner-material-pixel.is-filled{
  background:#237b47;
}
body.planner-plan-fullscreen .planner-material-pixels--partial .planner-material-pixel.is-filled{
  background:#bfe8c9;
  box-shadow:inset 0 0 0 1px #8fc49b;
}
body.planner-plan-fullscreen .planner-material-overflow{
  font:600 10px/1.2 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  color:var(--muted);
}
/* Previous warehouse material coloring is intentionally disabled in BOTH themes,
   including shortage badges: shortages remain available in the tooltip. */
body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip .planner-timeline-wh{
  background:rgba(145,174,208,.13);color:inherit;
  box-shadow:inset 0 0 0 1px rgba(145,174,208,.22);
  border:0;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-pixel{
  background:#d5e1ec;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-pixels--all .planner-material-pixel.is-filled{
  background:#237b47;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-pixels--partial .planner-material-pixel.is-filled{
  background:#bfe8c9;box-shadow:inset 0 0 0 1px #79b886;
}


/* Purchase orders: vertical scrolling inside the table, persistent column headings. */
.planner-purchases-scroll {
  max-height:calc(100dvh - 210px);
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
}
.planner-purchases-scroll .planner-table thead th {
  position:sticky;
  top:0;
  z-index:3;
  background:var(--table-head);
  box-shadow:0 1px 0 var(--line);
  white-space:nowrap;
}
.planner-purchases-scroll .planner-table th:nth-child(6),
.planner-purchases-scroll .planner-table td:nth-child(6) { text-align:right; }
@media (max-height:600px) {
  .planner-purchases-scroll { max-height:calc(100dvh - 130px); }
}

/* Purchase orders sortable headers: preserve the sticky heading and compact table. */
.planner-purchases-scroll .planner-purchase-sort { font-weight:inherit; }
.planner-purchases-scroll th[aria-sort=ascending] .planner-purchase-sort,
.planner-purchases-scroll th[aria-sort=descending] .planner-purchase-sort {
  color:var(--text);
  font-weight:800;
}

/* MTRL RISK: independent 5-pixel shortage indicator next to the green issue marker.
   Red bottom pixel = missing materials in BOM warehouse; second pale-green pixel
   = some remaining physical material on a different warehouse (NOT transferred).
   Keep both themes and aggregate WO cards consistent. */
body.planner-plan-fullscreen .planner-plan-material-risk-button {
  white-space:nowrap;
  letter-spacing:.01em;
}
body.planner-plan-fullscreen .planner-material-pixels--risk .planner-material-pixel.is-red,
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-pixels--risk .planner-material-pixel.is-red {
  background:#e34855;
  box-shadow:inset 0 0 0 1px #bc2938;
}
body.planner-plan-fullscreen .planner-material-pixels--risk .planner-material-pixel.is-other,
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-pixels--risk .planner-material-pixel.is-other {
  background:#bfe8c9;
  box-shadow:inset 0 0 0 1px #7cae86;
}

/* Make missing verification visible; it must NEVER look like adequate supply. */
body.planner-plan-fullscreen .planner-material-risk-summary{
  display:inline-flex;align-items:center;max-width:100%;padding:5px 9px;
  border:1px solid var(--line);background:var(--surface-raised);
  border-radius:7px;font-size:12px;font-weight:650;white-space:normal;
}
body.planner-plan-fullscreen .planner-material-risk-summary.is-unverified{
  color:#ffce82;border-color:#a77b3b;background:rgba(169,112,25,.13);
}
body.planner-plan-fullscreen .planner-material-risk-unknown{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:15px;border:1px solid #ba9248;border-radius:3px;
  color:#ffd28a;background:#634526;font-size:11px;font-weight:800;
  cursor:help;line-height:1;flex:0 0 auto;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-material-risk-unknown{
  color:#654000;background:#fff2d0;border-color:#b98b3c;
}

/* Server-persisted Planner Settings / Shortage Exceptions. */
.planner-nav-item .planner-nav-gear{font-family:Arial,"Segoe UI Symbol",sans-serif}
@media (min-width:801px){
  body.planner-plan-fullscreen .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph{font-size:22px;font-weight:400}
}
.planner-settings-panel{max-width:760px;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:21px}
.planner-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:15px}
.planner-settings-title{margin:0;font-size:19px;line-height:1.3;font-weight:700;color:var(--text)}
.planner-settings-add{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:var(--surface-raised);color:var(--text);font-size:24px;font-weight:500}
.planner-settings-description{font-size:12px;color:var(--muted);margin:10px 0 18px}
.planner-settings-list{display:grid;gap:7px}
.planner-settings-row{display:flex;align-items:center;gap:13px;min-height:44px;padding:6px 10px;background:var(--surface);border:1px solid var(--line);border-radius:9px}
.planner-settings-row input[type="checkbox"]{width:17px;height:17px;accent-color:#3185db;flex:none;cursor:pointer}
.planner-settings-code{font-size:13px;flex:1;min-width:0;overflow-wrap:anywhere;color:var(--text)}
.planner-settings-row:not(.planner-settings-draft):has(input:not(:checked)) .planner-settings-code{opacity:.52}
.planner-settings-row input[type="text"]{min-width:0;flex:1;height:32px;background:var(--input-bg);color:var(--text);border:1px solid var(--line);border-radius:7px;padding:0 10px;font-size:13px}
.planner-settings-save,.planner-settings-remove{border:1px solid var(--line);border-radius:7px;background:var(--surface-raised);color:var(--text);height:31px;min-width:31px;padding:0 10px;font-size:12px}
.planner-settings-remove{font-size:21px;padding:0 7px;font-weight:400}
.planner-settings-save:hover,.planner-settings-remove:hover,.planner-settings-add:hover{border-color:var(--blue)}
.planner-settings-message{min-height:17px;font-size:12px;color:var(--muted);margin:12px 0 0}
.planner-settings-message.is-error{color:#ed777c}
/* Compact, read-only iScala descriptions for shortage exceptions. */
.planner-settings-list{gap:5px;grid-template-columns:minmax(0,1fr);min-width:0}
.planner-settings-row{gap:8px;min-height:34px;padding:4px 8px;box-sizing:border-box;max-width:100%;min-width:0}
.planner-settings-row input[type="checkbox"]{width:15px;height:15px}
.planner-settings-code{flex:0 1 135px;min-width:58px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:600}
.planner-settings-item-description{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.35;color:var(--muted)}
.planner-settings-item-description.is-missing{opacity:.65;font-style:italic}
.planner-settings-row:not(.planner-settings-draft):has(input:not(:checked)) .planner-settings-item-description{opacity:.52}
.planner-settings-draft input[type="text"]{flex:0 1 135px;width:135px;min-width:0;height:27px;font-size:11px;padding:0 7px}
.planner-settings-row .planner-settings-save,.planner-settings-row .planner-settings-remove{height:27px;min-width:27px;font-size:11px;padding:0 8px}
.planner-settings-row .planner-settings-remove{font-size:18px;padding:0 6px}
@media(max-width:520px){.planner-settings-panel{padding:14px}.planner-settings-row{gap:6px;padding:4px 6px}.planner-settings-title{font-size:17px}.planner-settings-code,.planner-settings-draft input[type="text"]{flex-basis:105px;min-width:68px;width:105px}}

/* Local editable settings are not covered by the read-only ERP indicator. */
body.planner-settings-open .planner-header-readonly{display:none}

/* WO drag-and-drop keeps the original compact Production Plan layout. */
body.planner-plan-fullscreen .planner-wo-draggable{cursor:grab;user-select:none;-webkit-user-select:none}
body.planner-plan-fullscreen .planner-wo-draggable:active{cursor:grabbing}
body.planner-plan-fullscreen .planner-wo-dragging{opacity:.45}
/* Compact drag image communicates that one drag will move several selected WOs. */
.planner-wo-drag-preview{
  position:fixed;left:0;top:0;z-index:20000;pointer-events:none;
  display:inline-flex;align-items:center;min-height:34px;padding:7px 14px;
  border-radius:999px;border:1px solid var(--blue);
  background:var(--panel2);color:var(--text);
  box-shadow:0 5px 20px rgba(0,0,0,.20);
  font:600 12px/1.25 system-ui,-apple-system,"Segoe UI",sans-serif;
  white-space:nowrap;user-select:none;
}
/* Σ: click opens the WO list; dragging this same chip moves the entire group. */
body.planner-plan-fullscreen .planner-wo-total-selectable.planner-wo-draggable{cursor:grab}
body.planner-plan-fullscreen .planner-wo-total-selectable.planner-wo-draggable:active{cursor:grabbing}
body.planner-plan-fullscreen .planner-wo-total-selectable:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
body.planner-plan-fullscreen .planner-timeline-cell.planner-wo-drop-target{
  outline:2px dashed #67c3f5;outline-offset:-3px;background:rgba(54,150,220,.15)
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-cell.planner-wo-drop-target{
  background:rgba(31,125,213,.12)
}
/* Compact WO picker: just the WO number and its remaining quantity.
   Open below the chip, so neighboring week headers stay readable. */
.planner-wo-picker{
  position:fixed;z-index:11000;box-sizing:border-box;width:min(160px,calc(100vw - 16px));
  max-height:min(320px,75vh);padding:5px;border-radius:8px;
  overflow-y:auto;overflow-x:hidden;
  background:var(--panel2);color:var(--text);border:1px solid var(--line);
  box-shadow:0 9px 26px rgba(0,0,0,.32)
}
.planner-wo-picker-item{
  display:flex;align-items:center;justify-content:space-between;gap:7px;
  padding:5px 6px;margin-bottom:3px;border:1px solid var(--line);
  border-radius:6px;background:var(--surface-raised);color:var(--text);
  font-size:11px;font-weight:600;line-height:1.3;cursor:grab;
  white-space:nowrap;user-select:none;-webkit-user-select:none;
  font-variant-numeric:tabular-nums;
}
.planner-wo-picker-number{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.planner-wo-picker-qty{flex:0 1 auto;min-width:0;text-align:right;overflow:hidden;text-overflow:ellipsis}
.planner-wo-picker-item:last-child{margin-bottom:0}
.planner-wo-picker-item:hover{border-color:var(--blue)}
.planner-wo-picker-item:active{cursor:grabbing}

/* Started-WO visibility in the compact Σ week view. The underlying table
   dimensions, row heights and scrolling stay exactly as before. */
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total.planner-timeline-chip--started{
  background:#266f78;color:#f4fcfc;border-color:#519ca6;
  box-shadow:inset 0 0 0 1px #519ca6;
}
body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total.planner-timeline-chip--started-partial{
  box-shadow:inset 4px 0 0 #56b5ac;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total.planner-timeline-chip--started{
  background:#b6dee2;color:#184850;border-color:#74b4bb;
  /* A total chip already has a 1px border; the extra inset stroke doubled it. */
  box-shadow:none;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total.planner-timeline-chip--started-partial{
  box-shadow:inset 4px 0 0 #3c9998;
}
.planner-wo-picker-item.planner-wo-picker-item--started{
  background:#266f78;color:#f4fcfc;border-color:#519ca6;
}
html[data-theme="light"] .planner-wo-picker-item.planner-wo-picker-item--started{
  background:#b6dee2;color:#184850;border-color:#74b4bb;
}

/* Align the weekly-capacity setting with the warehouse transfer controls.
   Keep only the existing heading; no extra field label is needed. */
.planner-capacity-panel .planner-capacity-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:34px}
.planner-capacity-panel .planner-capacity-form input[type="number"]{box-sizing:border-box;width:90px;max-width:100%;height:34px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--text);font:inherit}
.planner-capacity-panel .planner-capacity-unit{white-space:nowrap}
.planner-capacity-panel .planner-capacity-form .planner-settings-save{margin-left:auto;align-self:center}

/* Settings: company-wide warehouse lead times, without changing Planner scrolling. */
.planner-transport-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 18px}
.planner-transport-field{display:flex;flex-direction:column;gap:7px;min-width:min(100%,230px);flex:1 1 230px}
.planner-transport-label{font-size:13px;font-weight:600}
.planner-transport-control{display:flex;align-items:center;gap:8px}
.planner-transport-control input{width:90px;max-width:100%;height:34px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--text);font:inherit}
.planner-transport-form .planner-settings-save{align-self:flex-end}

/* Dashboard: simple two-column list of finished products lacking WO capacity. */
/* Keep the Missing work orders section at content width, including when empty. */
.planner-dashboard-missing-group{margin-top:26px;width:fit-content;max-width:100%}
.planner-dashboard-missing-group > .planner-empty{padding:12px 16px;border-radius:10px}
.planner-dashboard-missing-group .planner-table-scroll{max-width:100%}
.planner-dashboard-missing-table th:last-child,
.planner-dashboard-missing-table td:last-child{text-align:right;font-variant-numeric:tabular-nums}

/* Dashboard: WO finish/closure and actual material issue exceptions. */
.planner-dashboard-completion-group{margin-top:26px}
.planner-dashboard-completion-group .planner-table-scroll{max-width:100%}
.planner-dashboard-completion-reasons{display:flex;flex-wrap:wrap;gap:6px}
.planner-dashboard-completion-table td:nth-child(2),
.planner-dashboard-completion-table th:nth-child(2),
.planner-dashboard-completion-table td:nth-child(3),
.planner-dashboard-completion-table th:nth-child(3){text-align:left}
.planner-dashboard-completion-label{display:inline-block;padding:2px 7px;border-radius:5px;
  font-size:11px;font-weight:600;color:var(--text);border:1px solid var(--border);
  background:var(--surface-2,rgba(130,144,160,.10))}

/* Warehouse selector for WO completion issues: keep the fieldset content-sized.
   The shared stock filter uses display:flex, which otherwise stretches it to
   the full Dashboard width because it overrides .planner-dashboard-warehouses. */
.planner-stock-warehouse-choices.planner-dashboard-completion-filters{
  display:inline-flex;
  width:max-content;
  max-width:100%;
  margin:0 0 12px;
}
.planner-dashboard-completion-table th:nth-child(3),
.planner-dashboard-completion-table td:nth-child(3){text-align:center;white-space:nowrap}
.planner-dashboard-completion-table th:nth-child(4),
.planner-dashboard-completion-table td:nth-child(4){text-align:left}


/* Weekly labor summary is always visible below the sticky date headings.
   Match the production grid's 1 code + N date columns exactly; unlike the
   old warehouse group, these cells NEVER span the whole calendar grid. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-label,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell{
  position:sticky;
  top:var(--planner-sticky-week-header-height, 45px);
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  box-sizing:border-box;
  padding:5px 6px;
  background:var(--table-head);
  color:var(--text);
  font:600 11px/1.35 Inter,"Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  border-bottom:1px solid var(--line);
  border-right:1px solid var(--line);
  box-shadow:inset 0 -1px 0 var(--line);
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-label{
  left:0;
  z-index:8;
  justify-content:flex-start;
  color:var(--muted);
  font-weight:550;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell--today{
  background:var(--surface-raised);
  font-weight:700;
}
/* Date headers remain above labor indicators during vertical scrolling,
   and stock code stays frozen when scrolling across weeks. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head{
  z-index:7;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:first-child{
  left:0;
  z-index:10;
}

/* Keep independent Settings sections comfortably separated on all themes.
   Do not affect Production Plan, Dashboard, or other cards. */
body.planner-settings-open .planner-settings-panel + .planner-settings-panel{
  margin-top:18px;
}
@media(max-width:600px){
  body.planner-settings-open .planner-settings-panel + .planner-settings-panel{
    margin-top:14px;
  }
}

/* Dashboard / Delivery risks (independent source-warehouse filter) */
.planner-dashboard-delivery-group{margin-top:26px}
.planner-dashboard-delivery-filters{margin:0 0 12px}
.planner-dashboard-delivery-scroll{max-width:100%}
.planner-dashboard-delivery-table{min-width:650px}
.planner-dashboard-delivery-table th,.planner-dashboard-delivery-table td{text-align:left!important;white-space:nowrap}
.planner-dashboard-delivery-table td:nth-child(n+3){font-variant-numeric:tabular-nums}

/* Delivery risks: compact search and descending-only sortable columns. */
.planner-dashboard-delivery-controls{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap;margin:0 0 12px}
.planner-dashboard-delivery-controls .planner-dashboard-delivery-filters{margin:0}
.planner-dashboard-delivery-search{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;min-width:170px}
.planner-dashboard-delivery-search input{width:190px;max-width:100%;min-height:33px;border:1px solid var(--line);border-radius:7px;padding:5px 10px;background:var(--input-bg);color:var(--text);font:inherit}
.planner-dashboard-delivery-search input:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}
.planner-dashboard-delivery-table{min-width:850px}
.planner-dashboard-delivery-table th{padding:0}
.planner-dashboard-delivery-table .planner-delivery-sort{display:inline-flex;align-items:center;gap:8px;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;cursor:pointer;padding:10px 9px;width:100%;white-space:nowrap;text-align:left}
.planner-dashboard-delivery-table .planner-delivery-sort:hover{color:var(--text)}
.planner-dashboard-delivery-table .planner-delivery-sort-arrow{opacity:.55}
.planner-dashboard-delivery-table .planner-delivery-sort.is-active .planner-delivery-sort-arrow{opacity:1;font-weight:800;color:var(--blue)}
.planner-dashboard-delivery-table td:nth-child(6){font-weight:600}
.planner-dashboard-delivery-table td.planner-dashboard-delivery-reason{font-weight:400;white-space:normal;min-width:180px;max-width:320px}

/* Delivery risks: light green only for forecast-on-time CO lines. */
.planner-dashboard-delivery-only{display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:600;white-space:nowrap;padding-bottom:7px;cursor:pointer}
.planner-dashboard-delivery-only input{accent-color:#26a269;width:15px;height:15px}
.planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time,
.planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:nth-child(even){background:#193e30;color:#d5f7e3}
.planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:hover,
.planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:nth-child(even):hover{background:#23513e;color:#edfff3}
html[data-theme="light"] .planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time,
html[data-theme="light"] .planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:nth-child(even){background:#dbf6e6;color:#1d4d30}
html[data-theme="light"] .planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:hover,
html[data-theme="light"] .planner-dashboard-delivery-table tbody tr.planner-dashboard-delivery-on-time:nth-child(even):hover{background:#c9eed8;color:#153b23}

/* Customer Delivery Forecast is its own page, not a section below Dashboard. */
.planner-cdf .planner-dashboard-delivery-group{margin-top:0}

/* Customer Delivery Forecast: keep column labels visible while scrolling orders.
   The vertical scrollbar belongs to this table only; horizontal scrolling remains
   available for narrow screens. No changes to the other Planner tables. */
.planner-cdf .planner-dashboard-delivery-scroll {
  max-height: calc(100dvh - 235px);
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.planner-cdf .planner-dashboard-delivery-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--table-head);
  box-shadow: 0 1px 0 var(--line);
}
@media (max-height: 600px) {
  .planner-cdf .planner-dashboard-delivery-scroll {
    max-height: calc(100dvh - 150px);
  }
}

/* CDF export button aligns to the right without shifting existing controls. */
.planner-cdf-export{margin-left:auto;white-space:nowrap;align-self:flex-end;min-height:34px}
@media(max-width:620px){.planner-cdf-export{margin-left:0}}


/* CDF only: keep the six identifying/date columns just wide enough for their
   content and give the remaining space to the comment timeline. Do not change
   the column widths or row padding of PP, CO, PO or Dashboard tables. */
.planner-cdf .planner-dashboard-delivery-table {
  min-width: 100%;
  width: 100%;
  table-layout: auto;
}
.planner-cdf .planner-dashboard-delivery-table th:nth-child(-n+6),
.planner-cdf .planner-dashboard-delivery-table td:nth-child(-n+6) {
  width: 1%;
  white-space: nowrap;
}
.planner-cdf .planner-dashboard-delivery-table td {
  padding: 8px 7px;
}
.planner-cdf .planner-dashboard-delivery-table .planner-delivery-sort {
  padding: 8px 7px;
  gap: 4px;
}
.planner-cdf .planner-dashboard-delivery-table th:last-child,
.planner-cdf .planner-dashboard-delivery-table td:last-child {
  width: auto;
}

/* When Comments is off, hide the timeline column, keep one-line rows,
   and spread the six identifying columns across the table. */
.planner-cdf .planner-dashboard-delivery-table.planner-dashboard-delivery-comments-hidden {
  min-width: 650px;
  width: 100%;
}
.planner-cdf .planner-dashboard-delivery-table.planner-dashboard-delivery-comments-hidden th:nth-child(-n+6),
.planner-cdf .planner-dashboard-delivery-table.planner-dashboard-delivery-comments-hidden td:nth-child(-n+6) {
  width: auto;
}

/* Expanded feasible-date column: one allocated WH02 availability per
   date, matching the original last feasible date. Do not wrap a date/qty pair. */
.planner-cdf .planner-dashboard-delivery-table td.planner-cdf-feasible-arrivals {
  white-space: pre;
  min-width: 160px;
  line-height: 1.55;
  vertical-align: top;
}
.planner-cdf .planner-dashboard-delivery-table td.planner-cdf-feasible-arrivals + td.planner-dashboard-delivery-reason {
  vertical-align: top;
}

/* CDF: one supply source per line; each line remains unbroken.
   The table's own horizontal scrollbar handles unusually long comments. */
.planner-cdf .planner-dashboard-delivery-table td.planner-dashboard-delivery-reason {
  min-width: 660px;
  max-width: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.55;
  vertical-align: middle;
}


/* CDF only: when Comments is enabled, align all cells to the top
   of each multiline delivery timeline row. With Comments off, the compact
   single-line table keeps its existing appearance. */
.planner-cdf .planner-dashboard-delivery-table:not(.planner-dashboard-delivery-comments-hidden) tbody td {
  vertical-align: top;
}

/* Fixed total-stock column in read-only Production Plan.
   Total is the imported physical stock balance on WH 01, 02 and 60,
   regardless of the WO filter, and is never a planned production quantity. */
body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock{
  position:sticky;
  left:var(--planner-code-column-width, 142px);
  z-index:3;
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  text-align:left;
  box-sizing:border-box;
  min-width:0;
  min-height:31px;
  padding:7px 8px;
  border-bottom:1px solid var(--line);
  border-right:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  font:600 11px/1.35 "Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  box-shadow:2px 0 3px rgba(0,0,0,.12);
}
body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock-header{
  position:sticky;
  left:var(--planner-code-column-width, 142px);
  top:0;
  z-index:9;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-align:left;
  padding-left:8px;
  background:var(--table-head);
  white-space:nowrap;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-stock{
  left:var(--planner-code-column-width, 142px);
  z-index:8;
  background:var(--table-head);
  box-shadow:2px 0 3px rgba(0,0,0,.12), inset 0 -1px 0 var(--line);
}
body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock.planner-timeline-row--selected{
  background:var(--surface-raised);
  box-shadow:inset 0 1px 0 rgba(145,186,228,.42),
             inset 0 -1px 0 rgba(145,186,228,.42),
             2px 0 3px rgba(0,0,0,.12);
}
html[data-density="comfortable"] body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock{
  min-height:40px;
}

/* Auto-sized fixed columns in Production Plan: never break an item code.
   A long code can expand the first track, without affecting Customer Orders. */
body.planner-plan-fullscreen .planner-plan-container .planner-timeline :is(button,div).planner-timeline-code{
  white-space:nowrap;
  overflow-wrap:normal;
}


/* Production Plan: soft, continuous highlight across the current ISO week.
   Restrict this to the weekly production grid; CO and other views are unchanged.
   WO chips retain their material, started and risk indicator colors. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell--current-week:not(.planner-wo-drop-target):not(.planner-timeline-row--selected){
  background:#243a53;
  box-shadow:inset 2px 0 0 rgba(111,179,241,.22), inset -2px 0 0 rgba(111,179,241,.22);
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell--current-week.planner-timeline-row--selected:not(.planner-wo-drop-target){
  background:#304b67;
  box-shadow:inset 2px 0 0 rgba(145,186,228,.44), inset -2px 0 0 rgba(145,186,228,.44),
             inset 0 1px 0 rgba(145,186,228,.42), inset 0 -1px 0 rgba(145,186,228,.42);
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell--today{
  background:#29496c;
  color:#e8eff8;
  box-shadow:inset 2px 0 0 rgba(111,179,241,.25), inset -2px 0 0 rgba(111,179,241,.25),
             inset 0 -1px 0 var(--line);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell--current-week:not(.planner-wo-drop-target):not(.planner-timeline-row--selected){
  background:#e4f0fc;
  box-shadow:inset 2px 0 0 rgba(52,125,190,.19), inset -2px 0 0 rgba(52,125,190,.19);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell--current-week.planner-timeline-row--selected:not(.planner-wo-drop-target){
  background:#cfe5f9;
  box-shadow:inset 2px 0 0 rgba(52,125,190,.4), inset -2px 0 0 rgba(52,125,190,.4),
             inset 0 1px 0 #96bfdf, inset 0 -1px 0 #96bfdf;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell--today{
  background:#d5e8fa;
  color:#174c81;
  box-shadow:inset 2px 0 0 rgba(52,125,190,.25), inset -2px 0 0 rgba(52,125,190,.25),
             inset 0 -1px 0 var(--line);
}

/* Optional, read-only Customer Orders overlay in Production Plan (OFF by default).
   Each ISO week has the regular resizable WO track plus a fixed, tiny CO track.
   All rules are scoped to .planner-pp-with-co: original plan stays unchanged. */
body.planner-plan-fullscreen .planner-plan-co-button{
  min-width:35px;
  padding-left:8px;
  padding-right:8px;
  font-weight:700;
  letter-spacing:.02em;
}
body.planner-plan-fullscreen .planner-plan-co-button.is-active{
  background:#205b93;
  border-color:#4d9cdd;
  color:#fff;
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-week-pair-head{
  box-sizing:border-box;
  min-width:0;
  grid-column:span 2;
  padding-bottom:0;
}
body.planner-plan-fullscreen .planner-pp-week-subheads{
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  align-self:stretch;
  margin:4px -3px 0;
  border-top:1px solid var(--line);
  font:650 9px/1.3 "Segoe UI",Arial,sans-serif;
  letter-spacing:.02em;
  color:var(--muted);
  text-align:center;
}
body.planner-plan-fullscreen .planner-pp-week-subheads > span{
  display:block;
  padding:3px 0 2px;
}
body.planner-plan-fullscreen .planner-pp-week-subheads > span + span{
  border-left:1px solid var(--line);
  background:rgba(75,133,185,.07);
  color:#92c2e9;
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-cell{
  box-sizing:border-box;
  min-width:0;
  width:48px;
  padding:3px 4px;
  background:color-mix(in srgb,var(--table-cell) 91%,#336a99);
  border-left:1px solid rgba(103,146,184,.35);
}
/* Plain read-only CO quantities, visually like Stock Σ rather than WO pills.
   They remain accessible buttons for inspecting the order-line breakdown. */
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-qty{
  display:block;
  box-sizing:border-box;
  appearance:none;
  width:100%;
  max-width:100%;
  margin:0 0 2px;
  padding:1px 0;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:transparent;
  color:var(--text);
  font:600 11px/1.35 "Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:left;
  cursor:pointer;
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-qty:hover{
  background:transparent;
  text-decoration:underline;
  text-underline-offset:2px;
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-qty:focus-visible{
  background:transparent;
  outline:1px dotted currentColor;
  outline-offset:1px;
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-placeholder{
  display:inline-block;
  font-size:11px;
  padding:3px 5px;
  color:var(--muted);
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-labor{
  min-width:0;
  background:var(--table-head);
  border-left:1px solid rgba(103,146,184,.35);
}
body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-labor.planner-timeline-time-cell--today{
  background:#29496c;
}
body.planner-plan-fullscreen .planner-pp-co-picker{
  width:185px;
  max-width:calc(100vw - 16px);
  max-height:300px;
  overflow:auto;
}
body.planner-plan-fullscreen .planner-pp-co-picker .planner-pp-co-picker-item{
  cursor:default;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-week-subheads > span + span{
  color:#285d86;
  background:rgba(44,107,158,.08);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-qty{
  background:transparent;
  color:var(--text);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-cell{
  background:#eff5fb;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-with-co .planner-pp-co-labor.planner-timeline-time-cell--today{
  background:#d5e8fa;
}

/* Production Plan CO-only delivery warning. Use the existing line-by-line
   Customer Delivery Forecast, never the WO chip color or a rough WO/CO ratio.
   Soft, desaturated coral is distinct from the blue current-week highlight.
   Risk emphasis has no extra left stripe. */
body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co .planner-pp-co-cell.planner-pp-co-cell--at-risk{
  background:#48333e;
}
body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co .planner-pp-co-cell--at-risk .planner-pp-co-qty--at-risk{
  color:#f5d3d9;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co .planner-pp-co-cell.planner-pp-co-cell--at-risk{
  background:#fae5e8;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co .planner-pp-co-cell--at-risk .planner-pp-co-qty--at-risk{
  color:#8a3644;
}


/* Settings: collapsed year-at-a-glance date marking calendar. No impact on WO/CO tables. */
.planner-calendar-settings-panel{padding:13px 16px}
.planner-calendar-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:18px}
.planner-calendar-settings-copy{min-width:0}
.planner-calendar-settings-hint{margin:5px 0 0;font-size:12px;color:var(--muted)}
.planner-calendar-open{flex:none;height:34px;padding:0 13px;font-weight:600}
.planner-calendar-dialog{box-sizing:border-box;border:1px solid var(--line);border-radius:16px;padding:0;
  width:min(920px,calc(100vw - 28px));max-width:none;max-height:96vh;overflow-y:auto;
  background:var(--panel);color:var(--text);box-shadow:0 22px 80px rgba(0,0,0,.4)}
.planner-calendar-dialog::backdrop{background:rgba(5,13,27,.7)}
.planner-calendar-dialog-inner{padding:17px 21px 13px}
.planner-calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;top:-17px;
  z-index:2;background:var(--panel);padding:6px 0 10px}
.planner-calendar-caption{display:flex;flex-direction:column;gap:4px}
.planner-calendar-subtitle{font-size:12px;color:var(--muted)}
.planner-calendar-controls{display:flex;align-items:center;gap:5px}
.planner-calendar-control,.planner-calendar-today,.planner-calendar-close{display:inline-grid;place-items:center;
  height:30px;min-width:30px;padding:0 8px;border:1px solid var(--line);border-radius:7px;
  color:var(--text);background:var(--surface-raised);font-size:13px;cursor:pointer}
.planner-calendar-control{font-size:23px;line-height:1}
.planner-calendar-close{font-size:23px;margin-left:7px}
.planner-calendar-year{min-width:48px;font-size:17px;text-align:center;font-variant-numeric:tabular-nums}
.planner-calendar-control:disabled{opacity:.4;cursor:default}
.planner-calendar-controls button:not(:disabled):hover{border-color:var(--blue)}
.planner-calendar-summary{display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:3px 0 12px;color:var(--muted);font-size:12px}
.planner-calendar-status.is-error{color:#e68089}
.planner-calendar-months{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:start}
.planner-calendar-month{box-sizing:border-box;min-width:0;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);padding:9px 9px 8px}
.planner-calendar-month-title{margin:0 0 7px;color:var(--text);font-size:12px;font-weight:700;text-align:center}
.planner-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;justify-items:center}
.planner-calendar-weekday,.planner-calendar-empty,.planner-calendar-day{box-sizing:border-box;display:grid;place-items:center;
  width:100%;max-width:25px;height:22px;font-variant-numeric:tabular-nums}
.planner-calendar-weekday{height:17px;font-size:10px;color:var(--muted);font-weight:600}
.planner-calendar-weekday.is-weekend{opacity:.65}
.planner-calendar-day{border:1px solid transparent;border-radius:5px;background:transparent;
  color:var(--text);font-size:11px;line-height:1;cursor:pointer;padding:0;font-family:inherit}
.planner-calendar-day.is-weekend:not(.is-marked){color:var(--muted)}
.planner-calendar-day:hover:not(:disabled):not(.is-marked){background:var(--surface-raised);border-color:var(--line)}
.planner-calendar-day.is-marked{background:#295d87;color:#fff;border-color:#548cb7;font-weight:700}
.planner-calendar-day.is-marked:hover:not(:disabled){background:#326e9d}
.planner-calendar-day.is-today:not(.is-marked){border-color:var(--blue);font-weight:700}
.planner-calendar-day:disabled{cursor:wait;opacity:.72}
.planner-calendar-day:focus-visible,.planner-calendar-controls button:focus-visible,.planner-calendar-open:focus-visible{
  outline:2px solid var(--blue);outline-offset:2px}
html[data-theme="light"] .planner-calendar-day.is-marked{background:#c9e2f7;color:#16476f;border-color:#5593c7}
html[data-theme="light"] .planner-calendar-day.is-marked:hover:not(:disabled){background:#b6d7f2}
.planner-calendar-loading{grid-column:1/-1;min-height:140px;display:grid;place-items:center;color:var(--muted)}
.planner-calendar-foot{font-size:11px;color:var(--muted);margin:10px 0 0}
@media(max-width:750px){.planner-calendar-months{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:590px){.planner-calendar-months{grid-template-columns:repeat(2,minmax(0,1fr))}
  .planner-calendar-dialog-inner{padding:12px}.planner-calendar-toolbar{top:-12px;flex-wrap:wrap}
  .planner-calendar-controls{width:100%;justify-content:flex-end}}
@media(max-width:350px){.planner-calendar-months{grid-template-columns:1fr}}
@media(max-width:520px){.planner-calendar-settings-heading{gap:10px}.planner-calendar-open{font-size:11px}}


/* Route-specific year calendar: ISO week numbers and two independent directions. */
.planner-calendar-summary{justify-content:flex-start;flex-wrap:wrap;gap:9px;padding-top:0}
.planner-calendar-routes{display:flex;gap:6px;flex:none}
.planner-calendar-route{height:27px;border-radius:7px;border:1px solid var(--line);padding:0 10px;
  background:var(--surface);color:var(--text);font-family:inherit;font-size:11px;font-weight:600;cursor:pointer}
.planner-calendar-route--materials.is-active{background:#274e73;border-color:#6599c9;color:#e7f3ff}
.planner-calendar-route--finished.is-active{background:#64415c;border-color:#bc819f;color:#fff0f7}
.planner-calendar-route:not(.is-active){opacity:.75}
.planner-calendar-route:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.planner-calendar-days{grid-template-columns:23px repeat(7,minmax(0,1fr));gap:2px}
.planner-calendar-weeknum{display:grid;place-items:center;box-sizing:border-box;height:22px;
  color:var(--muted);font-size:9px;font-variant-numeric:tabular-nums}
.planner-calendar-week-label{font-weight:700;color:var(--muted)}
.planner-calendar-day.is-material:not(.is-both){background:#35698e;color:#fff;border-color:#5b9bc0;font-weight:700}
.planner-calendar-day.is-finished:not(.is-both){background:#86536e;color:#fff;border-color:#bf829f;font-weight:700}
.planner-calendar-day.is-both{background:linear-gradient(135deg,#35698e 0%,#35698e 49%,#86536e 51%,#86536e 100%);
  color:#fff;border-color:#89a1c1;font-weight:700}
.planner-calendar-day.is-material:hover,.planner-calendar-day.is-finished:hover{filter:brightness(1.13)}
.planner-calendar-day.is-today:not(.is-material):not(.is-finished){border-color:var(--blue);font-weight:700}
html[data-theme="light"] .planner-calendar-route--materials.is-active{background:#d5eaf8;color:#245d88;border-color:#6ca7cf}
html[data-theme="light"] .planner-calendar-route--finished.is-active{background:#f4deeb;color:#804766;border-color:#c18daa}
html[data-theme="light"] .planner-calendar-day.is-material:not(.is-both){background:#c5e1f2;color:#195779;border-color:#77a9c6}
html[data-theme="light"] .planner-calendar-day.is-finished:not(.is-both){background:#f0cee0;color:#7a3c5d;border-color:#ca95b0}
html[data-theme="light"] .planner-calendar-day.is-both{background:linear-gradient(135deg,#c5e1f2 0%,#c5e1f2 49%,#f0cee0 51%,#f0cee0 100%);
  color:#213c51;border-color:#9c93b6}
@media(max-width:590px){.planner-calendar-summary{gap:6px}.planner-calendar-route{padding:0 8px}}

/* Production Plan: compact, exact WO-BOM material-code filter. */
body.planner-plan-fullscreen .planner-plan-tools input.planner-plan-material-search {
  width:122px;
  min-width:0;
  flex:0 0 122px;
  box-sizing:border-box;
  padding:7px 8px;
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
body.planner-plan-fullscreen .planner-plan-material-search:focus-visible {
  outline:2px solid #77afe0;
  outline-offset:1px;
}
@media(max-width:600px) {
  body.planner-plan-fullscreen .planner-plan-tools input.planner-plan-material-search {
    width:108px;
    flex-basis:108px;
  }
}

/* Planner sidebar scrolls independently of the page on desktop/short screens.
   Keep the existing horizontal navigation on narrow/mobile layouts. */
@media (min-width: 801px) {
  body.planner-open .planner-sidebar {
    max-height: calc(100vh - 78px);
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    /* Keep independent wheel/keyboard scrolling without reserving scrollbar space. */
    scrollbar-width: none; /* Firefox and modern Chromium */
    -ms-overflow-style: none; /* older Edge */
  }
  body.planner-open .planner-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* Stock: independent, read-only forecast of unissued WO materials and incoming PO. */
.planner-stock-transactions-toggle{white-space:nowrap;font-weight:600}
.planner-stock-transactions-toggle.is-active,
html[data-theme="light"] .planner-stock-transactions-toggle.is-active{
  background:var(--accent,#286caa);color:#fff;border-color:var(--accent,#286caa);
}
.planner-stock-tx-filter{padding:8px 12px;font-size:12px;font-weight:650;white-space:nowrap}
.planner-stock-tx-filter[hidden]{display:none}
.planner-stock-tx-filter.is-active,
html[data-theme="light"] .planner-stock-tx-filter.is-active{
  background:var(--accent,#286caa);color:#fff;border-color:var(--accent,#286caa);
}
.planner-stock-warehouse-disabled{opacity:.55}
.planner-stock-warehouse-disabled .planner-stock-warehouse-choice{cursor:default}
.planner-stock-warehouse-disabled input{cursor:default}
.planner-stock-projection-summary{display:flex;align-items:center;gap:24px;flex-wrap:wrap;
  margin:0 0 8px;font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;color:var(--text)}
.planner-stock-projection-note{margin:0 0 12px;font-size:11px;line-height:1.5;
  color:var(--muted);max-width:960px}
.planner-stock-projection-scroll{max-width:1050px;max-height:min(68vh,700px);overflow:auto;
  overscroll-behavior:contain}
.planner-stock-projection-table{width:100%;min-width:650px;
  font-variant-numeric:tabular-nums;font-size:12px;white-space:nowrap}
.planner-stock-projection-table th,
.planner-stock-projection-table td{padding:7px 11px}
.planner-stock-projection-table thead th{position:sticky;top:0;z-index:2;background:var(--table-head)}
.planner-stock-projection-table th:nth-child(6),
.planner-stock-projection-table th:nth-child(7),
.planner-stock-projection-table td:nth-child(6),
.planner-stock-projection-table td:nth-child(7){text-align:right}
.planner-stock-projection-table th:nth-child(2),
.planner-stock-projection-table td:nth-child(2){text-align:center}
.planner-stock-projection-table td:nth-child(3){font-weight:600}
.planner-stock-projection-table td:first-child{font-weight:450}
.planner-stock-projection-table .planner-stock-incoming{color:#68caa8}
.planner-stock-projection-table .planner-stock-outgoing{color:var(--text)}
.planner-stock-projection-table .planner-stock-negative-balance{color:#f09b9b;font-weight:650}
html[data-theme="light"] .planner-stock-projection-table .planner-stock-incoming{color:#08794e}
/* Planned Transactions: highlight PO receipts in blue, keep WO receipts green. */
.planner-stock-projection-table .planner-stock-projection-po .planner-stock-incoming{color:#78bbfa}
html[data-theme="light"] .planner-stock-projection-table .planner-stock-projection-po .planner-stock-incoming{color:#1569b9}
html[data-theme="light"] .planner-stock-projection-table .planner-stock-negative-balance{color:#b82f43}
@media(max-width:800px){.planner-stock-projection-summary{gap:8px 18px}}

/* Light-theme clarity pass — Production Plan only.
   Keep the existing dark palette and all functional/status colors unchanged.
   Separate controls, week headings and the sticky labor row without adding weight. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-sidebar{
  border-color:#bdcede;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-nav-item.is-active{
  background:#e0edf9;
  color:#154c7e;
  box-shadow:none;
}

/* Crisp inactive toolbar controls (active blue controls are intentionally excluded). */
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-tools .planner-simple-button:not(.is-active),
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-total-button:not(.is-active),
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display-trigger{
  background:#ffffff;
  color:#253e58;
  border-color:#aabdd1;
  box-shadow:0 1px 1px rgba(34,61,91,.055);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-tools .planner-simple-button:not(.is-active):hover:not(:disabled),
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-total-button:not(.is-active):hover,
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display-trigger:hover{
  background:#ecf4fd;
  border-color:#5989b8;
  color:#163f69;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-tools input.planner-plan-material-search{
  background:#fff;
  color:#20374e;
  border-color:#aabdd1;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-tools input.planner-plan-material-search:focus{
  border-color:#397bb4;
}

/* Define the planning canvas and its frozen week/date headings. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-wrap{
  border-color:#a9bed2;
  background:#fff;
  box-shadow:0 1px 2px rgba(39,71,107,.045);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head{
  background:#dfe9f4;
  color:#29445f;
  border-right-color:#b3c5d8;
  border-bottom-color:#a6bcd1;
  box-shadow:inset 0 -1px 0 #b9cbdc;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) strong{
  color:#203b56;
  font-weight:730;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) small{
  color:#456078;
  font-weight:550;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child){
  background:#c8e0f7;
  box-shadow:inset 0 -3px 0 #367cb9;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) strong{
  color:#144d80;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head--today:not(:first-child) small{
  color:#315a7e;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-week-sort:not(.is-active){
  color:#516f8b;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-week-sort:not(.is-active):hover{
  color:#fff;
  background:#356f9f;
}

/* Sticky labor estimates are a separate visual band below the week row. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-label,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell:not(.planner-timeline-time-cell--today){
  background:#edf3f9;
  color:#2e4964;
  border-right-color:#c1d0df;
  border-bottom:2px solid #9eb5cb;
  box-shadow:none;
  font-weight:650;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-time-cell--today{
  background:#cfe5fa;
  color:#154c7c;
  border-right-color:#a7c1d9;
  border-bottom:2px solid #5790c0;
  box-shadow:inset 2px 0 0 rgba(52,125,190,.25),inset -2px 0 0 rgba(52,125,190,.25);
  font-weight:750;
}

/* A clean, genuinely white working grid and readable cell divisions. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell:not(.planner-timeline-cell--current-week):not(.planner-timeline-row--selected):not(.planner-pp-co-cell):not(.planner-wo-drop-target){
  background:#fff;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks :is(button,div).planner-timeline-code,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-stock{
  border-bottom-color:#d2deea;
  border-right-color:#c5d3e1;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks :is(button,div).planner-timeline-code,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-stock{
  background:#fff;
  color:#263d55;
}
/* Preserve selected-row styling and the existing current-week blue highlight. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks :is(button,div).planner-timeline-code.planner-timeline-row--selected{
  background:#d1e8fa;
  color:#174c81;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell--current-week:not(.planner-wo-drop-target):not(.planner-timeline-row--selected){
  background:#e0effc;
  box-shadow:inset 2px 0 0 rgba(52,125,190,.23),inset -2px 0 0 rgba(52,125,190,.23);
}
/* CO overlay uses its own backgrounds; only strengthen its header separator. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-week-subheads{
  border-top-color:#b3c5d8;
  color:#355a7b;
}


/* Settings > Appearance: same browser-local theme and density options as before,
   now without the global header popup. */
.planner-appearance-fields{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-top:15px}
.planner-appearance-field{display:flex;flex-direction:column;gap:6px;min-width:160px;font-size:12px;font-weight:650;color:var(--muted)}
.planner-appearance-field select{width:190px;max-width:100%;height:36px;padding:0 11px;
  border:1px solid var(--line);border-radius:8px;background:var(--input-bg);
  color:var(--text);font-size:13px;cursor:pointer}
.planner-appearance-field select:hover{border-color:var(--blue)}
.planner-appearance-note{font-size:11px;color:var(--muted);margin:11px 0 0}
@media(max-width:520px){.planner-appearance-field{flex:1 1 125px;min-width:0}.planner-appearance-field select{width:100%}}

/* Light theme: the display-settings sliders must be legible without hovering.
   No changes to the dark theme or to the other toolbar buttons. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display .planner-plan-display-trigger,
html[data-theme="light"] .planner-orders-display .planner-orders-display-trigger{
  background:#fff;
  color:#1e5787;
  border-color:#729abf;
  box-shadow:0 1px 2px rgba(33,76,112,.10);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display .planner-plan-display-trigger svg,
html[data-theme="light"] .planner-orders-display .planner-orders-display-trigger svg{
  stroke-width:2.2;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display .planner-plan-display-trigger:hover,
html[data-theme="light"] .planner-orders-display .planner-orders-display-trigger:hover,
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-display[open] .planner-plan-display-trigger,
html[data-theme="light"] .planner-orders-display[open] .planner-orders-display-trigger{
  background:#eaf3fc;
  color:#124a7c;
  border-color:#367ab5;
}

/* Production Plan / light theme: a selected Days/Weeks control must remain
   dark blue and readable on hover (the generic hover otherwise washes it out). */
html[data-theme="light"] body.planner-plan-fullscreen .planner-plan-tools .planner-plan-modes .planner-simple-button.is-active:hover:not(:disabled) {
  background: #184f82;
  border-color: #184f82;
  color: #fff;
}


/* Production Plan: crisp, near-black quantities on the original blue WO chips.
   Light theme only; preserve every chip fill, border, status color and the CO overlay. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip:not(.planner-co-chip) > .planner-timeline-chip-text {
  color: #111827;
}

/* Light theme: less heavy quantity labels in grouped WO (Sigma) chips.
   Ordinary WO labels already use a lighter weight; CO and dark theme unchanged. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-timeline-chip--total:not(.planner-co-chip) > .planner-timeline-chip-text {
  font-weight:600;
}


/* Production Plan: center the dates under their week numbers and keep the
   two-line Stock / Sigma heading away from the narrow column's right edge.
   Used by both themes; the WO/CO plan content is not affected. */
body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock-header {
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  padding:4px 6px;
  text-align:center;
}
body.planner-plan-fullscreen .planner-timeline .planner-timeline-stock-header > span {
  display:block;
  line-height:1.15;
}
/* Light scheme: week numbers match the near-black WO quantity labels.
   Dark scheme retains its existing light text for proper contrast. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head:not(:first-child) strong {
  color:#111827;
}

/* Customer Orders / light theme: match Production Plan WO quantity text contrast.
   Keep blue chip fills and existing card states; dark theme remains unchanged. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-co-timeline .planner-co-chip > .planner-timeline-chip-text {
  color:#111827;
}

/* Production Plan: per-WO queue actions, in both Σ picker and individual view. */
body.planner-plan-fullscreen .planner-wo-selectable{cursor:pointer}
body.planner-plan-fullscreen .planner-wo-selectable:focus-visible,
.planner-wo-picker-item[role="button"]:focus-visible{
  outline:2px solid var(--blue);outline-offset:2px
}
.planner-wo-picker-item[role="button"]{cursor:pointer}
.planner-wo-picker-item[role="button"]:active{cursor:grabbing}
.planner-wo-actions{
  /* Fit the longest command (or WO number), instead of reserving 204 px. */
  width:max-content;max-width:calc(100vw - 16px);
  max-height:min(345px,80vh);
  padding:5px;border-radius:10px
}
.planner-wo-actions-heading{
  color:var(--text);font-size:11px;font-weight:650;
  padding:6px 8px 8px;margin-bottom:2px;
  border-bottom:1px solid var(--line);
  font-variant-numeric:tabular-nums
}
.planner-wo-action{
  /* Same distinct card rows as individual WOs in the expanded Σ list. */
  display:flex;align-items:center;
  width:100%;padding:5px 6px;margin:0 0 3px;
  text-align:left;background:var(--surface-raised);color:var(--text);
  border:1px solid var(--line);border-radius:6px;cursor:pointer;
  font:inherit
}
.planner-wo-action:last-child{margin-bottom:0}
.planner-wo-action:hover,.planner-wo-action:focus-visible{
  border-color:var(--blue);outline:none
}
.planner-wo-action:focus-visible{
  box-shadow:0 0 0 2px var(--focus-ring)
}
.planner-wo-action-label{font-size:10px;font-weight:400;line-height:1.3;white-space:nowrap}
/* Compact week calendar for WO queue moves. It sits alongside the narrow
   actions menu; the seven dates of a week are a single grid button, so the
   selected week never has displaced day cells. */
.planner-wo-week-calendar{
  position:fixed;z-index:11001;box-sizing:border-box;
  width:244px;max-width:calc(100vw - 16px);
  padding:10px 9px 9px;border:1px solid var(--line);border-radius:12px;
  background:var(--panel2);color:var(--text);
  box-shadow:0 12px 30px rgba(0,0,0,.24);
  font-variant-numeric:tabular-nums;
}
.planner-wo-week-calendar-month{
  text-align:center;font-size:12px;font-weight:650;line-height:20px;
  margin-bottom:6px;color:var(--text);
}
.planner-wo-week-calendar-weekdays,
.planner-wo-week-calendar-row{
  display:grid;grid-template-columns:27px repeat(7,minmax(0,1fr));
  align-items:center;gap:0;width:100%;
}
.planner-wo-week-calendar-weekdays{
  color:var(--muted);font-size:9px;font-weight:550;text-align:center;
  height:20px;margin-bottom:3px;
}
/* Always reserve six ISO-week rows (the maximum for a month), so the Move
   button stays in exactly the same position while scrolling between months.
   Unused rows remain blank without stretching the visible week rows. */
.planner-wo-week-calendar-rows{
  display:grid;
  grid-template-rows:repeat(6,27px);
  gap:3px;
}
.planner-wo-week-calendar-row{
  min-height:27px;padding:0;
  border:1px solid transparent;border-radius:7px;
  background:transparent;color:var(--text);
  font-family:inherit;font-size:11px;font-weight:500;line-height:1;
  text-align:center;cursor:pointer;
  transition:background-color .1s ease,border-color .1s ease;
}
.planner-wo-week-calendar-row:hover{background:var(--surface-raised);border-color:var(--line)}
.planner-wo-week-calendar-row.is-selected{
  background:var(--surface-raised);border-color:var(--blue);
}
.planner-wo-week-calendar-row:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.planner-wo-week-calendar-number{font-size:9px;color:var(--muted);font-weight:550}
.planner-wo-week-calendar-row.is-selected .planner-wo-week-calendar-number{
  color:var(--text);font-weight:650;
}
.planner-wo-week-calendar-day{display:grid;place-items:center;min-width:0;height:25px}
.planner-wo-week-calendar-day.is-outside-month{opacity:.38}
.planner-wo-week-calendar-move{
  display:block;width:100%;height:29px;margin-top:8px;
  border:1px solid var(--blue);border-radius:7px;
  background:var(--blue);color:#fff;
  font-family:inherit;font-size:11px;font-weight:600;cursor:pointer;
}
.planner-wo-week-calendar-move:hover{filter:brightness(1.06)}
.planner-wo-week-calendar-move:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
html[data-theme="light"] .planner-wo-week-calendar{
  box-shadow:0 9px 22px rgba(36,55,81,.18);
}
html[data-theme="light"] .planner-wo-week-calendar-row.is-selected{
  background:#e2effb;border-color:#6a9bc6;
}

/* Production Plan: optional multi-WO selection. Normal WO appearance and
   existing single-click actions remain unchanged until a WO is selected. */
.planner-wo-actions-heading--select{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
}
.planner-wo-multi-toggle{
  display:grid;place-items:center;flex:none;width:20px;height:20px;
  border:1px solid var(--line);border-radius:6px;
  background:var(--surface-raised);color:var(--text);
  font-size:15px;font-weight:500;line-height:1;cursor:pointer;
}
.planner-wo-multi-toggle:hover,
.planner-wo-multi-toggle:focus-visible{
  border-color:var(--blue);outline:none;background:var(--panel2);
}
.planner-wo-multi-toggle.is-selected{
  border-color:var(--blue);color:var(--blue);
}
.planner-wo-selection-clear{
  align-self:center;flex:none;padding:5px 9px;
  border:1px solid var(--blue);border-radius:8px;
  background:var(--surface-raised);color:var(--text);
  font-size:11px;line-height:1.25;white-space:nowrap;cursor:pointer;
}
.planner-wo-selection-clear[hidden]{display:none!important}
.planner-wo-selection-clear:hover{background:var(--panel2)}
body.planner-plan-fullscreen .planner-timeline-chip.planner-wo-multi-selected,
.planner-wo-picker-item.planner-wo-multi-selected{
  outline:2px solid var(--blue);outline-offset:1px;
}
/* In Σ mode the selected individual WOs may be hidden inside a total. Mark
   that total subtly without changing its status colors or border thickness. */
body.planner-plan-fullscreen .planner-timeline-chip.planner-wo-group-has-selected{
  outline:2px solid var(--blue);outline-offset:1px;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-wo-multi-selected,
html[data-theme="light"] .planner-wo-picker-item.planner-wo-multi-selected,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline-chip.planner-wo-group-has-selected{
  outline-color:#2976b8;
}

/* Compact Σ group select-all control: fits the existing WO-list width.
   Use the same selection state as the existing per-WO multi-select. */
.planner-wo-picker-select-all{
  position:sticky;top:-5px;z-index:1;
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  width:100%;min-height:23px;margin:0 0 3px;padding:3px 6px;
  border:1px solid var(--line);border-radius:6px;
  background:var(--panel2);color:var(--text);
  font-family:inherit;font-size:10px;font-weight:400;line-height:1.2;cursor:pointer;text-align:left;white-space:nowrap;
}
.planner-wo-picker-select-all:hover,
.planner-wo-picker-select-all:focus-visible{border-color:var(--blue);outline:none}
.planner-wo-picker-select-all-mark{
  display:grid;place-items:center;flex:none;width:13px;height:13px;
  border:1px solid var(--line);border-radius:3px;
  font-size:10px;line-height:1;color:var(--text);
}
.planner-wo-picker-select-all.is-selected .planner-wo-picker-select-all-mark{
  background:var(--blue);border-color:var(--blue);color:#fff;
}

/* Σ Select all: clearer checkbox in light mode, without altering the dark theme. */
.planner-wo-picker-select-all[hidden]{display:none!important}
html[data-theme="light"] .planner-wo-picker-select-all{
  color:#24364c;
  font-weight:500;
}
html[data-theme="light"] .planner-wo-picker-select-all-mark{
  width:15px;height:15px;
  border:1.5px solid #68829b;
  background:#fff;
  color:#24364c;
  font-size:11px;
}
html[data-theme="light"] .planner-wo-picker-select-all.is-selected .planner-wo-picker-select-all-mark{
  border-color:#276fae;
  background:#276fae;
  color:#fff;
}

/* The selection pill shares the existing breadcrumb line. No reflow on
   Select all, no movement of the plan under a floating Σ picker. */
body.planner-plan-fullscreen .planner-topline{position:relative}
body.planner-plan-fullscreen .planner-wo-selection-toolbar{
  position:absolute;right:0;top:50%;transform:translateY(-50%);
  z-index:5;display:flex;justify-content:flex-end;align-items:center;
  margin:0;min-height:0;
}
body.planner-plan-fullscreen .planner-wo-selection-toolbar[hidden]{display:none!important}
.planner-wo-selection-pill{
  display:inline-flex;align-items:center;gap:5px;max-width:100%;
  min-height:32px;padding:3px 4px 3px 11px;
  border:1px solid var(--line);border-radius:999px;
  background:var(--panel2);color:var(--text);
  box-shadow:0 2px 8px rgba(0,0,0,.09);
}
.planner-wo-selection-label{
  font-size:11px;font-weight:550;line-height:1.3;
  font-variant-numeric:tabular-nums;white-space:nowrap;
  padding:0 5px 0 0;
}
.planner-wo-selection-move{
  min-height:25px;padding:4px 13px;border:0;border-radius:999px;
  background:var(--blue);color:#fff;
  font:inherit;font-size:11px;font-weight:600;line-height:1.2;
  cursor:pointer;white-space:nowrap;
}
.planner-wo-selection-move:hover{filter:brightness(1.09)}
.planner-wo-selection-assign{background:var(--surface-raised);color:var(--text);
  border:1px solid var(--line);padding:3px 12px}
.planner-wo-selection-assign:hover{border-color:var(--blue);filter:none}
/* Assign picker: labels & checkboxes stay completely inside the scroll panel.
   Hover/focus use inset strokes, not outlines extending beyond the names. */
.planner-wo-assign-menu{
  width:min(286px,calc(100vw - 16px));max-height:min(425px,80vh);
  box-sizing:border-box;padding:10px;overflow-y:auto;overflow-x:hidden
}
.planner-wo-assign-menu *{box-sizing:border-box}
.planner-wo-assign-heading{font-size:12px;font-weight:650;margin:0 0 9px}
.planner-wo-assign-current{font-size:11px;color:var(--muted);padding:2px 0 8px}
.planner-wo-assign-note{font-size:11px;color:var(--muted);line-height:1.5;padding:5px 2px 8px}
.planner-wo-assign-search{
  display:block;width:100%;height:32px;border:1px solid var(--line);
  border-radius:7px;padding:5px 9px;background:var(--input-bg);color:var(--text);
  font:inherit;font-size:12px;margin-bottom:7px
}
.planner-wo-assign-list{
  display:flex;flex-direction:column;gap:2px;
  max-height:220px;min-width:0;padding:2px 3px 3px;
  overflow-y:auto;overflow-x:hidden
}
.planner-wo-assign-option{
  display:flex;align-items:center;justify-content:flex-start;gap:9px;
  min-width:0;max-width:100%;min-height:32px;width:100%;
  padding:6px 8px;border:0;border-radius:7px;
  background:transparent;color:var(--text);text-align:left;cursor:pointer;
  font:inherit;font-size:12px;line-height:1.3
}
.planner-wo-assign-option:hover,.planner-wo-assign-option:focus-within{
  background:var(--surface-raised);outline:0;
  box-shadow:inset 0 0 0 1px var(--blue)
}
.planner-wo-assign-checkbox{
  flex:0 0 auto;width:15px;height:15px;margin:0;
  accent-color:var(--blue);cursor:pointer
}
.planner-wo-assign-name{min-width:0;overflow-wrap:anywhere}
.planner-wo-assign-actions{display:flex;align-items:center;gap:6px;margin-top:9px;flex-wrap:wrap}
.planner-wo-assign-action{
  flex:1 1 auto;min-height:30px;padding:7px 9px;border:1px solid var(--line);
  border-radius:7px;background:var(--surface-raised);color:var(--text);
  font:inherit;font-size:11px;font-weight:600;cursor:pointer
}
.planner-wo-assign-action.is-primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.planner-wo-assign-action:hover:not(:disabled){filter:brightness(1.08)}
.planner-wo-assign-action:disabled{opacity:.45;cursor:default}
.planner-wo-assign-remove{
  margin-top:8px;width:100%;padding:7px 8px;
  border:1px solid var(--line);border-radius:7px;background:transparent;
  color:var(--text);font:inherit;font-size:11px;cursor:pointer
}
.planner-wo-assign-remove:hover{border-color:var(--blue);background:var(--surface-raised)}
.planner-wo-assign-menu.is-saving{pointer-events:none;opacity:.6}
.planner-wo-selection-dismiss{
  width:25px;height:25px;display:grid;place-items:center;
  border:0;border-radius:50%;background:transparent;color:var(--muted);
  font-family:inherit;font-size:20px;font-weight:350;line-height:1;
  cursor:pointer;
}
.planner-wo-selection-dismiss:hover{background:var(--surface-raised);color:var(--text)}
.planner-wo-selection-move:focus-visible,
.planner-wo-selection-dismiss:focus-visible{
  outline:2px solid var(--blue);outline-offset:2px;
}
/* One understated grouped menu instead of four boxed buttons. */
.planner-wo-actions{
  padding:5px;border-radius:12px;
  box-shadow:0 12px 32px rgba(0,0,0,.19);
}
.planner-wo-actions .planner-wo-actions-heading{
  margin-bottom:3px;padding:6px 8px 8px;
  font-weight:600;font-size:11px;
}
.planner-wo-actions .planner-wo-action{
  margin:0;padding:7px 9px;min-height:28px;
  border:0;border-radius:7px;background:transparent;
}
.planner-wo-actions .planner-wo-action:hover,
.planner-wo-actions .planner-wo-action:focus-visible{
  border-color:transparent;background:var(--surface-raised);
}
.planner-wo-actions .planner-wo-action-label{
  font-size:11px;font-weight:450;line-height:1.3;
}
html[data-theme="light"] .planner-wo-selection-pill{
  background:#fff;box-shadow:0 2px 8px rgba(35,55,80,.09);
}
html[data-theme="light"] .planner-wo-selection-dismiss{color:#65778d}

/* Light theme: clearly show the hovered queue command in the compact Move menu.
   No size/position changes, so the Σ menu never shifts or covers its anchor. */
html[data-theme="light"] .planner-wo-actions .planner-wo-action:hover,
html[data-theme="light"] .planner-wo-actions .planner-wo-action:focus-visible{
  background:#e5f1fc;
  color:#13568e;
  box-shadow:inset 0 0 0 1px #b9d5ed;
}

/* Started (teal) WOs in an expanded Σ list should highlight on hover in
   both themes, just like unstarted WO rows. Keep their status colour and any
   persistent multi-selection outline. */
.planner-wo-picker-item.planner-wo-picker-item--started:hover,
.planner-wo-picker-item.planner-wo-picker-item--started:focus-visible{
  background:#327d87;
  border-color:var(--blue);
  box-shadow:inset 0 0 0 1px rgba(145,207,248,.20);
}
html[data-theme="light"] .planner-wo-picker-item.planner-wo-picker-item--started:hover,
html[data-theme="light"] .planner-wo-picker-item.planner-wo-picker-item--started:focus-visible{
  background:#9dcdd6;
  border-color:#2676b9;
  box-shadow:inset 0 0 0 1px rgba(38,118,185,.22);
}


/* Consistent, readable hover feedback for the top-right Move commands.
   Keep the dark menu as compact as the light one. */
html:not([data-theme="light"]) .planner-wo-actions .planner-wo-action:hover,
html:not([data-theme="light"]) .planner-wo-actions .planner-wo-action:focus-visible{
  background:#355577;
  color:#f8fbff;
  box-shadow:inset 0 0 0 1px #628fbf;
}


/* Production Plan — one intrinsic, content-safe width for ALL WO chips:
   direct week-cell children and marker-wrapped cards alike. No forced 132px
   minimum: that would overflow the 112px week columns unnecessarily.
   Separate CO cells and the material indicators retain their own layout. */
body.planner-plan-fullscreen .planner-timeline .planner-timeline-cell .planner-timeline-chip.planner-wo-selectable,
body.planner-plan-fullscreen .planner-timeline .planner-timeline-cell .planner-timeline-chip.planner-timeline-chip--total:not(.planner-co-chip){
  box-sizing:border-box;
  width:var(--planner-wo-uniform-width, max-content);
  flex:0 0 auto;
}

/* Keep the default-density WO label comfortably inside the existing
   112px weekly column even when a remaining quantity is shown in brackets.
   This changes only individual WO/Σ chips, not CO or material indicators.
   Comfortable density deliberately keeps its larger typography. */
html:not([data-density="comfortable"]) body.planner-plan-fullscreen .planner-timeline .planner-timeline-cell .planner-timeline-chip.planner-wo-selectable,
html:not([data-density="comfortable"]) body.planner-plan-fullscreen .planner-timeline .planner-timeline-cell .planner-timeline-chip.planner-timeline-chip--total:not(.planner-co-chip){
  font-size:11px;
  padding:4px 4px;
  letter-spacing:-.1px;
}

/* Forecast Balance: a compact 66px weekly track beside WO / optional CO.
   Uses the same frozen row grid; no separate table or scrolling surface. */
body.planner-plan-fullscreen .planner-plan-balance-button{
  min-width:56px;
  padding-left:9px;
  padding-right:9px;
  font-weight:650;
}
body.planner-plan-fullscreen .planner-plan-balance-button.is-active{
  background:#205b93;
  border-color:#4d9cdd;
  color:#fff;
}
body.planner-plan-fullscreen .planner-pp-week-subheads--balance-only{
  grid-template-columns:minmax(0,1fr) 66px;
}
body.planner-plan-fullscreen .planner-pp-week-subheads--co-balance{
  grid-template-columns:minmax(0,1fr) 48px 66px;
}
body.planner-plan-fullscreen .planner-pp-week-subheads--balance-only > span:last-child,
body.planner-plan-fullscreen .planner-pp-week-subheads--co-balance > span:last-child{
  color:#aecde9;
  background:rgba(75,133,185,.1);
}
body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell{
  box-sizing:border-box;
  min-width:0;
  width:66px;
  padding:4px 5px;
  background:color-mix(in srgb,var(--table-cell) 93%,#3e739c);
  border-left:1px solid rgba(103,146,184,.4);
  text-align:left;
  font-variant-numeric:tabular-nums;
}
body.planner-plan-fullscreen .planner-pp-balance-amount{
  text-align:left;
  display:block;
  max-width:100%;
  font:650 10.5px/1.45 "Segoe UI",Arial,sans-serif;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell--negative{
  background:#422c34;
  box-shadow:inset 2px 0 #bc7584;
}
body.planner-plan-fullscreen .planner-pp-balance-cell--negative .planner-pp-balance-amount{
  color:#ffb5c1;
}
body.planner-plan-fullscreen .planner-pp-balance-cell--unknown .planner-pp-balance-amount{
  color:var(--muted);
}
body.planner-plan-fullscreen .planner-pp-balance-labor{
  background:var(--table-head);
  border-left:1px solid rgba(103,146,184,.4);
}
body.planner-plan-fullscreen .planner-pp-balance-labor.planner-timeline-time-cell--today{
  background:#29496c;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-week-subheads--balance-only > span:last-child,
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-week-subheads--co-balance > span:last-child{
  background:#e8f0f8;
  color:#365f83;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell{
  background:#f3f7fb;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell.planner-timeline-cell--current-week{
  background:#e2effc;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell--negative,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline .planner-pp-balance-cell--negative.planner-timeline-cell--current-week{
  background:#fbe9eb;
  box-shadow:inset 2px 0 #ce8190;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-balance-cell--negative .planner-pp-balance-amount{
  color:#9f3349;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-pp-balance-labor.planner-timeline-time-cell--today{
  background:#d5e8fa;
}

/* Balance negative state must win over the generic light-theme white cell and
   current-week selection rules; otherwise a shortage looks like a normal row. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative.planner-timeline-cell--current-week{
  background:#422c34;
  box-shadow:inset 2px 0 #bc7584;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative.planner-timeline-cell--current-week{
  background:#fbe9eb;
  box-shadow:inset 2px 0 #ce8190;
}
/* The established light-theme white-cell rule has multiple :not() selectors.
   Scope these overrides tightly so Balance remains legible without changing WO/CO. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell:not(.planner-pp-balance-cell--negative){
  background:#f3f7fb !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell.planner-timeline-cell--current-week:not(.planner-pp-balance-cell--negative){
  background:#e2effc !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative{
  background:#fbe9eb !important;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative{
  background:#422c34 !important;
}

/* Production Plan: labor is centered beneath the Mon–Fri dates, above the
   optional WO / CO / Balance labels. No separate sticky labor grid row. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor{
  display:block;
  align-self:stretch;
  text-align:center;
  white-space:nowrap;
  font:650 11px/1.35 Inter,"Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  color:var(--text);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor{
  color:#294e70;
}
/* Historical weeks retain their WO heading but have no Balance track. */
body.planner-plan-fullscreen .planner-pp-week-subheads--wo-only{
  grid-template-columns:minmax(0,1fr);
}

/* Production Plan / CO: delivery-risk warning must take precedence over the
   current-week blue highlight. Keep the existing risk palette in both themes.
   Affects CO cells only; WO and Balance week highlighting stays unchanged. */
body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co
.planner-timeline-cell.planner-pp-co-cell.planner-pp-co-cell--at-risk.planner-timeline-cell--current-week{
  background:#48333e;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co
.planner-timeline-cell.planner-pp-co-cell.planner-pp-co-cell--at-risk.planner-timeline-cell--current-week{
  background:#fae5e8;
}

/* Balance: negative values are indicated only by red numbers.
   Keep the standard cell backgrounds and remove the left shortage stripe. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative{
  background:color-mix(in srgb,var(--table-cell) 93%,#3e739c) !important;
  box-shadow:none !important;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative.planner-timeline-cell--current-week{
  background:#243a53 !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative{
  background:#f3f7fb !important;
  box-shadow:none !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-balance-cell--negative.planner-timeline-cell--current-week{
  background:#e2effc !important;
}

/* Production Plan: the current week is identified by its subtle background,
   not by heavier grid separators. Use the same native 1px borders as other
   weeks in both themes. Keep drag/drop targets and WO status styling intact. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head.planner-timeline-head--today,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head.planner-timeline-head--today {
  box-shadow:none;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-timeline-cell--current-week:not(.planner-wo-drop-target),
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-timeline-cell--current-week.planner-timeline-row--selected:not(.planner-wo-drop-target),
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-timeline-cell--current-week:not(.planner-wo-drop-target),
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-timeline-cell--current-week.planner-timeline-row--selected:not(.planner-wo-drop-target) {
  box-shadow:none;
}

/* Production Plan: one continuous shade across each week heading.
   WO, CO and Balance labels share the parent week background instead of
   being tinted independently. The current week retains its own blue shade.
   Grid borders and the actual WO / CO / Balance rows are untouched. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads > span {
  background:transparent !important;
}

/* Production Plan: make each WO / CO / Balance subcolumn legible without
   changing the common background of the week heading. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads{
  text-align:left;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads > span{
  box-sizing:border-box;
  text-align:left;
  padding:3px 4px 2px;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads > span + span{
  border-left:1px solid #7f98b3;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-pp-week-subheads > span + span{
  border-left-color:#a7bacd;
}
/* Product code stays frozen and spans the same grid row; its label starts
   at the top rather than being vertically centered within a tall WO row. */
body.planner-plan-fullscreen .planner-timeline :is(button,div).planner-timeline-code{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  text-align:left;
}


/* Production Plan / Σ: show a weekly WO total as plain text rather than a
   filled, bordered WO card. This targets ONLY the draggable total in the
   Production Plan: individual WO cards, CO, Balance and picker rows are intact.
   Leave the original element/event handlers in place for click, keyboard and
   drag/drop. A selected WO group is indicated by a text underline instead of
   a rectangle, and started groups keep a discreet teal text color. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-timeline-chip--total.planner-wo-total-selectable,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-timeline-chip--total.planner-wo-total-selectable {
  display:inline-flex;
  box-sizing:border-box;
  flex:0 0 auto;
  width:max-content !important;
  max-width:100%;
  padding:4px 5px;
  margin:0 0 2px;
  border:0 !important;
  border-radius:0;
  background:transparent !important;
  box-shadow:none !important;
  outline:none;
  color:var(--text);
  font-weight:650;
}
/* Do not let the light-theme chip-specific text color suppress started status. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable > .planner-timeline-chip-text,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable > .planner-timeline-chip-text {
  color:var(--text);
  font-weight:650;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started > .planner-timeline-chip-text {
  color:#83d3d2;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started-partial > .planner-timeline-chip-text {
  color:#80bdbb;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started > .planner-timeline-chip-text {
  color:#126d73;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started-partial > .planner-timeline-chip-text {
  color:#337a7a;
}
/* An understated text-only affordance for opening the WO picker. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable:hover > .planner-timeline-chip-text,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable:focus-visible > .planner-timeline-chip-text,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-wo-group-has-selected > .planner-timeline-chip-text {
  text-decoration:underline;
  text-decoration-color:var(--blue);
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}
/* A keyboard focus indicator appears only while keyboard-focused. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable:focus-visible {
  outline:2px solid var(--blue) !important;
  outline-offset:1px;
}


/* Production Plan / Σ: show started status across the WO CELL, not as a
   small chip. Reuse the already-computed startedCount from app.js:
     all started = clear, gentle teal; mixed = lighter mint;
     none = ordinary week background.
   No changes to individual WO cards, CO, Balance or drag/drop targets. */
body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-sigma-all-started:not(.planner-wo-drop-target) {
  background:#28565e !important;
}
body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-sigma-partial-started:not(.planner-wo-drop-target) {
  background:#263f44 !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-sigma-all-started:not(.planner-wo-drop-target) {
  background:#b6dee2 !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-sigma-partial-started:not(.planner-wo-drop-target) {
  background:#dfefef !important;
}
/* Keep Σ as plain, clickable numbers, not colored text or bordered cards. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started > .planner-timeline-chip-text,
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started-partial > .planner-timeline-chip-text,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started > .planner-timeline-chip-text,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell
.planner-timeline-chip.planner-wo-total-selectable.planner-timeline-chip--started-partial > .planner-timeline-chip-text {
  color:var(--text);
}


/* Production Plan: keep current-week WO cells neutral when no work order has
   started. The active week stays identifiable in its header and in CO/Balance.
   Started and partially started Σ totals retain their full-cell green shades.
   Preserve selected-row feedback and the WO drag/drop target highlight. */
body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-timeline-cell--current-week:not(.planner-pp-co-cell):not(.planner-pp-balance-cell):not(.planner-pp-sigma-all-started):not(.planner-pp-sigma-partial-started):not(.planner-timeline-row--selected):not(.planner-wo-drop-target) {
  background:var(--table-cell);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-timeline-cell--current-week:not(.planner-pp-co-cell):not(.planner-pp-balance-cell):not(.planner-pp-sigma-all-started):not(.planner-pp-sigma-partial-started):not(.planner-timeline-row--selected):not(.planner-wo-drop-target) {
  background:#fff;
}

/* Planner shared date/week calendar: WO Move, Production Plan and Customer Orders.
   The same visual language in both themes; only day/week selection differs. */
.planner-date-picker-trigger{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  white-space:nowrap;min-width:78px;font-variant-numeric:tabular-nums;
  cursor:pointer;
}
.planner-date-picker-trigger svg{flex:none;opacity:.78}
.planner-date-picker-trigger-label{font-weight:550}
.planner-date-picker-trigger:hover{border-color:var(--blue)}
.planner-date-picker-trigger:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.planner-shared-date-calendar .planner-date-calendar-month{
  display:grid;grid-template-columns:27px 1fr 27px;align-items:center;
  margin-bottom:6px;min-height:23px;
}
.planner-date-calendar-month-name{text-align:center}
.planner-date-calendar-month-step{
  display:grid;place-items:center;padding:0;width:26px;height:24px;
  border:1px solid transparent;border-radius:7px;
  background:transparent;color:var(--text);font:inherit;font-size:19px;
  line-height:1;cursor:pointer;
}
.planner-date-calendar-month-step:hover{background:var(--surface-raised);border-color:var(--line)}
.planner-date-calendar-month-step:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.planner-shared-date-calendar .planner-date-calendar-day-row{
  display:grid;grid-template-columns:27px repeat(7,minmax(0,1fr));
  align-items:center;gap:0;width:100%;min-height:27px;
}
.planner-date-calendar-day-row>.planner-wo-week-calendar-number{text-align:center}
.planner-date-calendar-day{
  display:grid;place-items:center;min-width:0;width:100%;height:26px;
  padding:0;border:1px solid transparent;border-radius:6px;
  background:transparent;color:var(--text);font:inherit;font-size:11px;
  line-height:1;cursor:pointer;
}
.planner-date-calendar-day:hover{background:var(--surface-raised);border-color:var(--line)}
.planner-date-calendar-day.is-selected{background:var(--surface-raised);border-color:var(--blue);font-weight:750}
.planner-date-calendar-day.is-today:not(.is-selected){box-shadow:inset 0 -1px var(--blue)}
.planner-date-calendar-day.is-outside-month{opacity:.43}
.planner-date-calendar-day:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-1px}
html[data-theme="light"] .planner-date-calendar-day.is-selected{
  background:#e2effb;border-color:#6a9bc6;
}

/* Dashboard: overdue, still-open WO. The header remains visible while the
   backlog scrolls; each header sorts without changing the other Dashboard panels. */
.planner-dashboard-backlog-group{margin-top:26px;min-width:0}
.planner-dashboard-backlog-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.planner-dashboard-backlog-heading h2{margin:0}
.planner-stock-warehouse-choices.planner-dashboard-backlog-warehouses{
  display:inline-flex;width:max-content;max-width:100%;min-height:34px;
  padding:3px 9px;gap:10px;margin:2px 0 0;
}
.planner-dashboard-backlog-empty{margin-top:12px}
.planner-dashboard-backlog-count{display:inline-flex;align-items:center;justify-content:center;
  padding:2px 8px;min-width:25px;border-radius:999px;background:var(--surface-raised);
  color:var(--muted);font-size:11px;font-weight:650;font-variant-numeric:tabular-nums}
.planner-dashboard-backlog-scroll{margin-top:12px;max-height:min(495px,70vh);max-width:100%;
  overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:10px}
.planner-dashboard-backlog-table{width:100%;min-width:750px;border-collapse:separate;
  border-spacing:0;font-variant-numeric:tabular-nums}
.planner-dashboard .planner-dashboard-backlog-table thead th{position:sticky;top:0;z-index:1;
  padding:0;background:var(--table-head);white-space:nowrap}
.planner-dashboard-backlog-table .planner-dashboard-backlog-sort{width:100%;display:flex;
  align-items:center;justify-content:space-between;gap:9px;text-align:left;
  border:0;background:transparent;color:inherit;cursor:pointer;
  padding:10px 12px;font:inherit;font-weight:650;white-space:nowrap}
.planner-dashboard-backlog-table .planner-dashboard-backlog-sort:hover{background:var(--surface-raised);color:var(--text)}
.planner-dashboard-backlog-table .planner-dashboard-backlog-sort:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}
.planner-dashboard-backlog-sort-icon{color:var(--muted);font-size:12px;line-height:1}
.planner-dashboard-backlog-table [aria-sort]:not([aria-sort="none"]) .planner-dashboard-backlog-sort-icon{color:var(--blue)}
.planner-dashboard-backlog-table td{vertical-align:top;white-space:nowrap}
.planner-dashboard-backlog-table td.planner-dashboard-backlog-qty{text-align:right}
.planner-dashboard-backlog-table td.planner-dashboard-backlog-code,
.planner-dashboard-backlog-table td.planner-dashboard-backlog-wo{font-weight:600}
.planner-dashboard-backlog-tag{display:inline-flex;align-items:center;padding:2px 7px;
  border-radius:5px;font-size:11px;line-height:1.45;font-weight:600;
  border:1px solid var(--line);background:var(--surface-raised);color:var(--muted)}
.planner-dashboard-backlog-tag.is-started{background:rgba(48,155,148,.16);color:#75d8cc;border-color:rgba(85,184,177,.3)}
html[data-theme="light"] .planner-dashboard-backlog-tag.is-started{background:#dcf3ef;color:#16645f;border-color:#a2d6cd}
.planner-dashboard-backlog-table td.planner-dashboard-backlog-materials{min-width:240px;white-space:normal}
.planner-dashboard-backlog-issue{font-weight:550;line-height:1.4}
.planner-dashboard-backlog-risk{margin-top:3px;color:var(--muted);font-size:12px;line-height:1.45}
.planner-dashboard-backlog-risk.is-risk{color:#e8a58b}
html[data-theme="light"] .planner-dashboard-backlog-risk.is-risk{color:#a33f28}
.planner-dashboard-backlog-risk.is-unknown{color:var(--muted)}
.planner-dashboard-backlog-risk-label{display:block;font-weight:600}
.planner-dashboard-backlog-risk-item{display:block;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:700px){
  .planner-dashboard-backlog-scroll{max-height:65vh}
  .planner-dashboard-backlog-table{min-width:720px}
}
/* The shared comfortable-density rule pads table headers; the sortable header
   button owns this padding, so prevent double spacing in this table only. */
html[data-density="comfortable"] .planner-dashboard .planner-dashboard-backlog-table thead th{padding:0}
html[data-density="comfortable"] .planner-dashboard-backlog-table .planner-dashboard-backlog-sort{padding:12px 13px}

/* Dashboard only: match all panel headings to the Started work orders title. */
.planner-dashboard:not(.planner-cdf) .planner-group h2{font-size:15px}

/* Shared routing Queue Time control (Planner Settings). */
.planner-queue-time-option{display:inline-flex;align-items:center;gap:10px;margin-top:13px;color:var(--text);font-size:14px;font-weight:550;cursor:pointer}
.planner-queue-time-option input{width:17px;height:17px;accent-color:var(--blue);cursor:pointer;flex:none}
.planner-queue-time-panel .planner-settings-description{margin:8px 0 0;max-width:620px;line-height:1.5}

/* Synchronization and Settings: match Dashboard section headings (15px / 650). */
body.planner-settings-open .planner-settings-title,
.planner-view:has(.planner-nav-item[data-planner-page="sync"].is-active) #plannerContent > h2 {
  font-size: 15px;
  font-weight: 650;
}

/* Production Plan / PO: show the CDF-available finished-goods receipts in the
   same compact 48px text column as CO. This is a read-only quantity, not a
   second forecast. Keep the grid borders and both theme colors consistent. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-po-cell{
  box-sizing:border-box;
  width:48px;
  min-width:0;
  padding:3px 4px;
  border-left:1px solid rgba(103,146,184,.35);
  background:color-mix(in srgb,var(--table-cell) 91%,#336a99);
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-pp-po-qty{
  display:block;
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  padding:1px 0;
  margin:0 0 2px;
  border:0;
  background:transparent;
  color:var(--text);
  font:600 11px/1.35 "Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:left;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-pp-po-placeholder{
  display:inline-block;
  padding:3px 5px;
  font-size:11px;
  color:var(--muted);
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-po-cell{
  background:#eff5fb;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-cell.planner-pp-po-cell.planner-timeline-cell--current-week{
  background:#e0effc;
}
/* The generic light-theme white-cell selector has extra :not() specificity.
   Keep PO tinted like CO without suppressing the selected-row highlight. */
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-po-cell:not(.planner-timeline-row--selected){
  background:#eff5fb !important;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks
.planner-timeline-cell.planner-pp-po-cell.planner-timeline-cell--current-week:not(.planner-timeline-row--selected){
  background:#e0effc !important;
}


/* Production Plan / Σ: show aggregated WO hours at the far right of the WO
   subcolumn, AFTER the optional material issue and risk indicators. Keep
   ordinary WO cards, CO/PO/Balance and the Σ click/drag target unchanged. */
body.planner-plan-fullscreen .planner-material-order-row.planner-material-order-row--sigma-time{
  box-sizing:border-box;
  width:100%;
  min-width:max-content;
}
body.planner-plan-fullscreen .planner-material-order-row--sigma-time > .planner-pp-sigma-time{
  flex:0 0 auto;
  margin-left:auto;
  padding:0 2px;
  color:var(--muted);
  font:600 11px/1.3 'Segoe UI',Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  text-align:right;
}

/* PRC: same compact hierarchy and palette as Stock; no layout changes elsewhere. */
.planner-price-tools{gap:10px;flex-wrap:wrap}
.planner-price-tools .planner-price-export{margin-left:auto;min-width:75px}
.planner-price-table{width:100%}
.planner-price-table th:nth-child(2),.planner-price-table td:nth-child(2){min-width:200px}
.planner-price-table th:nth-child(5),.planner-price-table td:nth-child(5){text-align:right;white-space:nowrap}
.planner-price-table td:nth-child(1),.planner-price-table td:nth-child(3),
.planner-price-table td:nth-child(4),.planner-price-table td:nth-child(6),
.planner-price-table td:nth-child(7){white-space:nowrap}
.planner-price-hint{font-size:11px;color:var(--muted);margin:10px 0 0}
@media(max-width:650px){.planner-price-tools .planner-price-export{margin-left:0}}

/* PRC import diagnostics: visible without adding another panel. */
.planner-price-diagnostic{font-size:12px;line-height:1.5;margin:4px 0 10px;overflow-wrap:anywhere}
.planner-price-diagnostic.planner-error{font-size:12px}


/* PRC v14: isolate table geometry from the five-column Stock table.
   The original 5 Stock widths totalled 100%, leaving zero space for
   the PRC Currency and Unit columns. Both views now have explicit widths. */
.planner-price-modes{display:inline-flex;align-items:center;gap:3px;padding:3px;
  border:1px solid var(--line);background:var(--surface);border-radius:11px;margin:0 0 12px}
.planner-price-mode-button{border:0;border-radius:8px;background:transparent;
  color:var(--muted);padding:8px 14px;font-size:13px;font-weight:600;line-height:1.3;
  font-family:inherit;cursor:pointer}
.planner-price-mode-button.is-active{background:var(--table-head);color:var(--text);
  box-shadow:0 1px 3px rgba(0,0,0,.08)}
.planner-price-table-wrap{width:100%;max-width:100%;overflow-x:auto}
.planner-price-table{width:100%;min-width:1000px;table-layout:fixed}
.planner-price-table--costs{min-width:890px}
.planner-price-table th,.planner-price-table td{box-sizing:border-box;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.planner-price-table td:nth-child(2){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.planner-price-table th:nth-child(1){width:17%}
.planner-price-table th:nth-child(2){width:33%;min-width:0}
.planner-price-table th:nth-child(3){width:7%}
.planner-price-table th:nth-child(4){width:12%}
.planner-price-table th:nth-child(5){width:11%}
.planner-price-table th:nth-child(6){width:11%}
.planner-price-table th:nth-child(7){width:9%}
.planner-price-table--costs th:nth-child(1){width:19%}
.planner-price-table--costs th:nth-child(2){width:33%}
.planner-price-table--costs th:nth-child(3){width:8%}
.planner-price-table--costs th:nth-child(4){width:16%}
.planner-price-table--costs th:nth-child(5){width:16%}
.planner-price-table--costs th:nth-child(6){width:8%}
.planner-price-table th:nth-child(1),.planner-price-table td:nth-child(1),
.planner-price-table th:nth-child(2),.planner-price-table td:nth-child(2),
.planner-price-table th:nth-child(3),.planner-price-table td:nth-child(3),
.planner-price-table th:nth-child(4),.planner-price-table td:nth-child(4),
.planner-price-table th:nth-child(5),.planner-price-table td:nth-child(5),
.planner-price-table th:nth-child(6),.planner-price-table td:nth-child(6),
.planner-price-table th:nth-child(7),.planner-price-table td:nth-child(7){min-width:0}
.planner-price-table--selling th:nth-child(4),
.planner-price-table--selling td:nth-child(4){text-align:center}
.planner-price-table--selling th:nth-child(5),
.planner-price-table--selling td:nth-child(5),
.planner-price-table--costs th:nth-child(4),
.planner-price-table--costs td:nth-child(4),
.planner-price-table--costs th:nth-child(5),
.planner-price-table--costs td:nth-child(5){text-align:right}
.planner-price-table--costs th:nth-child(6),
.planner-price-table--costs td:nth-child(6){text-align:center}


/* Synchronization: consistent compact status typography and accessible colors.
   Scoped to this screen so other dashboards and Production Plan are unchanged. */
.planner-sync-overview .planner-metric strong{
  font-size:12px;
  line-height:1.4;
  font-weight:650;
  color:var(--text);
  overflow-wrap:anywhere;
}
.planner-sync-overview .planner-metric .planner-sync-overview-value--ok{color:#9fe3be}
.planner-sync-overview .planner-metric .planner-sync-overview-value--updating{color:#f2d58c}
.planner-sync-overview .planner-metric .planner-sync-overview-value--error{color:#ffaaa9}
.planner-sync-progress .planner-sync-progress-stage{color:var(--text)}
.planner-sync-progress .planner-sync-progress-detail{color:var(--muted)}
.planner-sync-device-online{color:#9fe3be;font-weight:600}
.planner-sync-device-offline{color:var(--muted);font-weight:550}
html[data-theme="light"] .planner-sync-overview .planner-metric .planner-sync-overview-value--ok{color:#17633b}
html[data-theme="light"] .planner-sync-overview .planner-metric .planner-sync-overview-value--updating{color:#805700}
html[data-theme="light"] .planner-sync-overview .planner-metric .planner-sync-overview-value--error{color:#a82434}
html[data-theme="light"] .planner-sync-device-online{color:#17633b}

/* Individual Planner menu grants — no change to existing nav geometry. */
.planner-nav-item[hidden],.user-menu-access[hidden]{display:none!important}
.user-menu-access{margin:6px 0 14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.user-menu-access-heading{font-weight:700;font-size:15px}
.user-menu-access-help{margin:5px 0 11px;color:var(--muted);font-size:12px;line-height:1.5}
.user-menu-access-options{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;max-width:490px}
.user-menu-access-row{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:38px;padding:8px 10px;border-radius:7px;font-size:13px;cursor:pointer}
.user-menu-access-row:hover{background:var(--table-cell)}
.user-menu-access-row input{width:17px;height:17px;flex:0 0 auto;accent-color:var(--blue);cursor:pointer}

/* Nested Planner Settings permissions (Admin → Edit user → Menu access). */
.user-menu-settings-subitems{grid-column:1;margin:2px 0 8px 12px;padding:8px 0 8px 14px;border-left:2px solid var(--line);display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.user-menu-settings-hint{grid-column:1/-1;font-size:12px;font-weight:650;color:var(--muted);padding:0 8px 4px}
.user-menu-settings-row{font-size:12px;min-height:35px}
.user-menu-settings-row:has(input:disabled){opacity:.5;cursor:default}
.user-menu-settings-row input:disabled{cursor:default}

/* Production Plan multi-code picker: visual-only filter, anchored to sticky Code. */
body.planner-plan-fullscreen .planner-code-filter-head{min-width:86px}
body.planner-plan-fullscreen .planner-code-filter-head-controls{
  display:flex;align-items:center;gap:3px;white-space:nowrap;
}
body.planner-plan-fullscreen .planner-code-filter-trigger{
  display:inline-flex;align-items:center;gap:5px;min-height:24px;
  background:transparent;border:1px solid transparent;border-radius:5px;
  color:inherit;font:inherit;font-weight:750;padding:2px 4px;cursor:pointer;
}
body.planner-plan-fullscreen .planner-code-filter-trigger:hover,
body.planner-plan-fullscreen .planner-code-filter-trigger[aria-expanded="true"]{
  background:var(--surface-raised);border-color:var(--line);
}
body.planner-plan-fullscreen .planner-code-filter-trigger.is-active{color:var(--blue)}
body.planner-plan-fullscreen .planner-code-filter-trigger:focus-visible,
body.planner-plan-fullscreen .planner-code-filter-reset:focus-visible{
  outline:2px solid var(--blue);outline-offset:1px;
}
body.planner-plan-fullscreen .planner-code-filter-count{
  min-width:16px;min-height:16px;padding:1px 4px;line-height:14px;
  background:var(--blue);color:#fff;border-radius:8px;text-align:center;font-size:10px;
}
body.planner-plan-fullscreen .planner-code-filter-chevron{
  display:inline-block;flex:none;width:0;height:0;margin-left:1px;
  border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid currentColor;opacity:.8;
}
body.planner-plan-fullscreen .planner-code-filter-reset{
  display:inline-flex;align-items:center;justify-content:center;
  width:20px;height:22px;padding:0;border:0;border-radius:5px;
  color:var(--muted);background:transparent;font-size:17px;cursor:pointer;
}
body.planner-plan-fullscreen .planner-code-filter-reset:hover{background:var(--surface-raised);color:var(--text)}
.planner-code-filter-popover{
  position:fixed;z-index:10050;box-sizing:border-box;
  display:flex;flex-direction:column;gap:8px;
  width:min(316px,calc(100vw - 16px));max-height:min(460px,calc(100dvh - 16px));
  padding:12px;color:var(--text);background:var(--panel);
  border:1px solid var(--line);border-radius:11px;
  box-shadow:0 16px 40px rgba(0,0,0,.30);font:12px/1.4 'Segoe UI',Arial,sans-serif;
}
.planner-code-filter-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
.planner-code-filter-close{background:transparent;border:0;border-radius:5px;color:var(--muted);font-size:19px;line-height:1;cursor:pointer}
.planner-code-filter-close:hover{background:var(--surface-raised);color:var(--text)}
.planner-code-filter-summary{color:var(--muted);font-size:11px}
.planner-code-filter-search{
  width:100%;box-sizing:border-box;min-height:34px;padding:6px 9px;
  border:1px solid var(--line);border-radius:7px;background:var(--surface);
  color:var(--text);font:500 12px 'Segoe UI',Arial,sans-serif;
}
.planner-code-filter-search:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
.planner-code-filter-list{
  flex:1 1 auto;min-height:46px;overflow:auto;border:1px solid var(--line);
  border-radius:7px;padding:3px;overscroll-behavior:contain;
}
.planner-code-filter-option{display:flex;align-items:center;gap:9px;min-height:32px;padding:4px 8px;
  border-radius:5px;cursor:pointer;white-space:nowrap}
.planner-code-filter-option:hover{background:var(--surface-raised)}
.planner-code-filter-option input[type="checkbox"]{
  flex:0 0 auto;width:16px;height:16px;margin:0;accent-color:var(--blue);cursor:pointer;
}
.planner-code-filter-code{overflow:hidden;text-overflow:ellipsis;font-weight:600}
.planner-code-filter-option--outside{opacity:.68}
.planner-code-filter-empty{padding:14px 8px;text-align:center;color:var(--muted)}
.planner-code-filter-footer{display:flex;align-items:center;justify-content:space-between;gap:8px}
.planner-code-filter-hint{color:var(--muted);font-size:10px}
.planner-code-filter-clear{
  min-height:29px;padding:5px 10px;white-space:nowrap;
  border:1px solid var(--line);border-radius:6px;
  background:var(--surface-raised);color:var(--text);font:600 11px 'Segoe UI',Arial,sans-serif;
  cursor:pointer;
}
.planner-code-filter-clear:hover:not(:disabled){border-color:var(--blue)}
.planner-code-filter-clear:disabled{opacity:.45;cursor:default}

/* Product-code priority is right-aligned in the existing Code cell.
   Low = five gray pixels, High = five light-blue, Critical = five deep-blue.
   Medium reserves the same space but shows only a gray hover/focus affordance.
   This edit control never selects the row or changes WO data. */
body.planner-plan-fullscreen .planner-code-priority-line{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:6px;width:100%;min-width:0;box-sizing:border-box;
}
body.planner-plan-fullscreen .planner-code-priority-label{
  min-width:0;flex:1 1 auto;overflow-wrap:anywhere;
}
body.planner-plan-fullscreen .planner-code-priority-trigger{
  display:inline-flex;align-items:center;justify-content:center;
  align-self:flex-start;flex:0 0 21px;
  min-width:21px;width:21px;height:29px;margin:-3px -4px -3px 0;
  padding:2px;border:1px solid transparent;border-radius:5px;
  background:transparent;cursor:pointer;transition:background .12s,box-shadow .12s,opacity .12s;
}
body.planner-plan-fullscreen .planner-code-priority-trigger--medium{opacity:0}
/* A selected Code row must not reveal the Medium affordance just
   because the row stays hovered or keyboard-focused after selection.
   Directly hovering or focusing the edit button still allows editing. */
body.planner-plan-fullscreen .planner-timeline-code:not(.planner-timeline-row--selected):hover .planner-code-priority-trigger--medium,
body.planner-plan-fullscreen .planner-code-priority-trigger--medium:hover{
  opacity:1;
}
body.planner-plan-fullscreen .planner-timeline-code:hover .planner-code-priority-trigger,
body.planner-plan-fullscreen .planner-code-priority-trigger:hover,
body.planner-plan-fullscreen .planner-code-priority-trigger[aria-expanded="true"]{
  background:rgba(84,151,212,.17);box-shadow:0 0 0 1px rgba(102,171,233,.7);
}
body.planner-plan-fullscreen .planner-code-priority-trigger--medium[aria-expanded="true"]{opacity:1}
body.planner-plan-fullscreen .planner-code-priority-trigger:focus-visible{
  opacity:1;outline:2px solid var(--blue);outline-offset:0;
}
.planner-code-priority-indicator{
  display:inline-grid;grid-template-rows:repeat(5,4px);row-gap:1px;
  width:8px;min-width:8px;flex:0 0 8px;vertical-align:middle;
}
.planner-code-priority-pixel{
  display:block;width:8px;height:4px;border-radius:1px;
}
.planner-code-priority-indicator--critical .planner-code-priority-pixel{background:#2473ce}
.planner-code-priority-indicator--high .planner-code-priority-pixel{background:#58b6e9}
.planner-code-priority-indicator--low .planner-code-priority-pixel,
.planner-code-priority-indicator--medium .planner-code-priority-pixel{background:#8995a3}
/* Inline editor floats above the sticky grid and stays reachable on small screens. */
.planner-inline-priority-menu{
  position:fixed;z-index:10060;box-sizing:border-box;
  width:178px;max-width:calc(100vw - 16px);
  padding:7px;background:var(--panel);color:var(--text);
  border:1px solid var(--line);border-radius:9px;
  box-shadow:0 14px 36px rgba(0,0,0,.26);
  font:12px/1.35 'Segoe UI',Arial,sans-serif;
}
.planner-inline-priority-title{
  font-size:11px;color:var(--muted);font-weight:700;
  padding:5px 7px 7px;border-bottom:1px solid var(--line);margin-bottom:4px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.planner-inline-priority-option{
  display:flex;align-items:center;gap:9px;width:100%;min-height:33px;
  padding:5px 8px;border:0;border-radius:5px;
  color:var(--text);background:transparent;text-align:left;
  font:600 12px 'Segoe UI',Arial,sans-serif;cursor:pointer;
}
.planner-inline-priority-option:hover,
.planner-inline-priority-option[aria-pressed="true"]{background:var(--surface-raised)}
.planner-inline-priority-option:focus-visible{outline:2px solid var(--blue);outline-offset:-1px}
.planner-inline-priority-option:disabled{opacity:.5;cursor:progress}
.planner-inline-priority-swatch{height:13px;width:6px;border-radius:2px;flex:none;background:#8995a3}
.planner-inline-priority-swatch--critical{background:#2473ce}
.planner-inline-priority-swatch--high{background:#58b6e9}
.planner-inline-priority-swatch--medium{background:transparent;border:1px dashed #8995a3}
.planner-inline-priority-check{margin-left:auto;color:var(--blue);font-weight:800}
.planner-code-filter-popover{width:min(370px,calc(100vw - 16px))}
.planner-code-filter-columns{
  display:grid;grid-template-columns:minmax(0,1fr) 101px;align-items:center;
  padding:0 8px 0 33px;gap:8px;font-weight:700;font-size:11px;color:var(--muted);
}
.planner-code-filter-option{
  display:grid;grid-template-columns:minmax(0,1fr) 101px;gap:8px;
  padding:3px 6px;min-height:33px;cursor:default;
}
.planner-code-filter-option-label{
  display:flex;align-items:center;gap:9px;min-width:0;cursor:pointer;
}
.planner-code-filter-priority-select{
  box-sizing:border-box;display:block;width:101px;min-width:0;min-height:27px;
  padding:3px 18px 3px 6px;border:1px solid var(--line);border-radius:5px;
  background:var(--surface);color:var(--text);font:600 11px/1.25 "Segoe UI",Arial,sans-serif;
  cursor:pointer;
}
.planner-code-filter-priority-select:hover{border-color:var(--blue)}
.planner-code-filter-priority-select:focus-visible{
  outline:2px solid var(--blue);outline-offset:1px;
}
.planner-code-filter-priority-select.is-saving{opacity:.55;cursor:progress}

/* Employees (EMP) — compact, editable Saldoissa-only register. */
.planner-emp-panel{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:18px;margin:0 0 20px}
.planner-emp-heading{font-size:15px;font-weight:750;letter-spacing:0;margin:0 0 14px;color:var(--text)}
.planner-emp-form{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:end}
.planner-emp-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.planner-emp-field>span{color:var(--muted);font-size:12px;font-weight:650}
.planner-emp-field input,.planner-emp-field select,.planner-emp-list-head input{
  min-width:0;width:100%;height:39px;padding:0 10px;border:1px solid var(--line);
  border-radius:9px;color:var(--text);background:var(--input-bg);font-size:13px;outline:none
}
.planner-emp-field :is(input,select):focus-visible,.planner-emp-list-head input:focus-visible{
  border-color:var(--focus-ring);box-shadow:0 0 0 2px rgba(115,174,236,.16)
}
.planner-emp-actions{grid-column:1/-1;display:flex;align-items:center;gap:8px;margin-top:4px}
.planner-emp-save,.planner-emp-cancel,.planner-emp-row-button{
  border:1px solid var(--line);border-radius:9px;background:var(--surface-raised);
  color:var(--text);min-height:35px;padding:6px 12px;font-size:13px;font-weight:650
}
.planner-emp-save{background:var(--blue);color:#fff;border-color:transparent}
.planner-emp-save:disabled,.planner-emp-row-button:disabled{opacity:.55}
.planner-emp-message{min-height:18px;margin:9px 0 0;font-size:12px;color:var(--muted)}
.planner-emp-message.is-error{color:#df656a}
.planner-emp-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px}
.planner-emp-list-head .planner-emp-heading{margin:0}
.planner-emp-list-head input{width:min(250px,55%)}
.planner-emp-scroll{width:100%;overflow:auto}
.planner-emp-table{min-width:700px;white-space:normal}
.planner-emp-table th,.planner-emp-table td{padding:9px 11px;line-height:1.35}
.planner-emp-table td:nth-child(3){font-variant-numeric:tabular-nums}
.planner-emp-row-actions{white-space:nowrap;text-align:right}
.planner-emp-row-button{min-height:29px;padding:4px 9px;font-size:12px}
.planner-emp-row-button+.planner-emp-row-button{margin-left:6px}
.planner-emp-delete{background:transparent;color:var(--muted)}
.planner-emp-delete:hover{color:#e46969;border-color:#e46969}
.planner-emp-empty{padding:16px 2px;color:var(--muted);font-size:13px;margin:0}
@media (max-width:960px){.planner-emp-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:650px){.planner-emp-form{grid-template-columns:repeat(2,minmax(0,1fr))}.planner-emp-panel{padding:13px}}
@media (max-width:450px){.planner-emp-form{grid-template-columns:1fr}}

/* Optional second week workload: ONLY visible WO cards. Numbers are red;
   baseline workload, labels and other week header elements retain their style. */
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor--filtered{
  margin-top:0;
}
body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor-filtered-number,
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor-filtered-number{
  color:#df4848;
  font-weight:750;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks .planner-timeline-head .planner-week-labor-filtered-number{
  color:#c62836;
}

/* Worker Plan: the same compact two-axis production calendar, grouped by employee.
   All styles are isolated from Production Plan and ERP/stock calculations. */
.worker-plan{min-width:0;width:100%}
.worker-plan-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.worker-plan-search{width:170px;min-width:110px;max-width:100%;height:37px;padding:7px 10px;
  border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font-size:12px}
.worker-plan-search:focus-visible{outline:2px solid #68ade0;outline-offset:1px}
.worker-plan-warehouses{display:inline-flex;align-items:center;gap:11px;min-width:0;padding:5px 10px;
  border:1px solid var(--line);border-radius:9px;margin-left:auto;color:var(--text)}
.worker-plan-warehouses legend{padding:0 5px;color:var(--muted);font-size:11px}
.worker-plan-warehouse-label{display:inline-flex;align-items:center;gap:5px;cursor:pointer;font-size:12px}
.worker-plan-warehouse-label input{margin:0;accent-color:#327ab9;width:15px;height:15px}
.worker-plan-count{min-height:17px;margin:0 0 7px;font-size:11px}
body.planner-plan-fullscreen .worker-plan-scroll{
  height:max(260px,calc(100dvh - 180px));overflow:auto;width:100%;
  border:1px solid var(--line);border-radius:9px;overscroll-behavior:contain;
  scrollbar-gutter:stable;background:var(--panel)}
.worker-plan-grid{display:grid;width:max-content;min-width:100%;align-content:start}
.worker-plan-head{position:sticky;top:0;z-index:6;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:3px;min-height:77px;padding:8px 5px;
  text-align:center;white-space:nowrap;color:var(--text);
  background:var(--surface-raised);border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.worker-plan-head strong{font-size:12px}
.worker-plan-head span{font-size:11px;font-weight:500;color:var(--muted)}
.worker-plan-head.is-current{box-shadow:inset 0 -3px 0 #65a7da}
.worker-plan-worker-head{left:0;z-index:9;align-items:flex-start;padding-left:13px;min-width:175px;font-weight:800}
.worker-plan-worker{position:sticky;left:0;z-index:4;display:flex;align-items:flex-start;
  padding:11px 11px;min-width:175px;max-width:280px;font-size:13px;font-weight:700;
  overflow-wrap:anywhere;background:var(--panel);color:var(--text);
  border-right:2px solid var(--line);border-bottom:1px solid var(--line)}
.worker-plan-cell{display:flex;flex-direction:column;gap:3px;padding:5px 5px;
  min-height:53px;min-width:245px;border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);background:var(--panel)}
.worker-plan-cell.is-current{background:color-mix(in srgb,var(--surface-raised) 36%,var(--panel))}
.worker-plan-card{padding:6px 7px;border-radius:5px;border:1px solid var(--line);
  background:var(--surface);font-size:11px;line-height:1.4;color:var(--text)}
/* Match started WO cards in Production Plan: full teal fill, not a thin edge. */
.worker-plan-card.is-started{
  background:#266f78;color:#f4fcfc;border-color:#519ca6
}
html[data-theme="light"] .worker-plan-card.is-started{
  background:#b6dee2;color:#184850;border-color:#74b4bb
}
.worker-plan-card.is-started .worker-plan-comment-button,
.worker-plan-card.is-started .worker-plan-comment-divider,
.worker-plan-card.is-started .worker-plan-card-unassign{color:inherit}
.worker-plan-card.is-started .worker-plan-comment-divider{opacity:.72}
.worker-plan-card-main{display:flex;gap:4px;align-items:baseline;flex-wrap:nowrap;white-space:nowrap;min-width:0}
.worker-plan-card-main>strong,.worker-plan-card-main>span{flex-shrink:0}
.worker-plan-card-main strong{font-size:11px;font-weight:750}
.worker-plan-card-comment-line{display:flex;gap:4px;align-items:baseline;min-width:0;flex:1 1 auto;overflow:hidden}
.worker-plan-card-main.is-editing{flex-wrap:wrap}
.worker-plan-card-main.is-editing .worker-plan-card-comment-line{flex:0 0 100%;width:100%;overflow:visible;white-space:normal}
.worker-plan-comment-divider{color:var(--muted);flex-shrink:0}
.worker-plan-comment-button{display:inline-block;min-width:0;max-width:100%;
  padding:0 2px;border:0;border-radius:3px;background:transparent;color:var(--muted);
  font:inherit;font-size:11px;line-height:1.45;text-align:left;cursor:pointer;
  flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.worker-plan-comment-button:not(:empty):hover,.worker-plan-comment-button:focus-visible{
  background:var(--surface-raised);color:var(--text);outline:1px solid var(--line)}
.worker-plan-comment-editor{width:100%;max-width:100%;min-width:0}
.worker-plan-comment-editor textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box;
  padding:5px 6px;border:1px solid var(--line);border-radius:5px;
  color:var(--text);background:var(--panel);font:inherit;font-size:12px;resize:vertical}
/* The Worker Plan uses the same issue/risk indicator styles as Production Plan. */
body.planner-plan-fullscreen .worker-plan-material-indicators{
  display:inline-flex;align-items:center;gap:3px;flex:0 0 auto;margin-left:3px;
}
.worker-plan-comment-phrases{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin-top:5px}
.worker-plan-comment-phrase{border:1px solid var(--line);border-radius:5px;
  background:var(--surface-raised);color:var(--text);padding:3px 6px;
  font:600 11px/1.3 Inter,"Segoe UI",ui-sans-serif,Arial,sans-serif;
  cursor:pointer;white-space:nowrap}
.worker-plan-comment-phrase:hover,.worker-plan-comment-phrase:focus-visible{
  border-color:#65a7da;background:var(--surface);outline:1px solid #65a7da;
}
.worker-plan-comment-actions{display:flex;justify-content:flex-end;gap:5px;margin-top:4px}
.worker-plan-comment-actions .planner-simple-button{font-size:11px;padding:4px 8px}
.worker-plan-empty{grid-column:1 / -1;padding:24px;color:var(--muted);font-size:12px}
@media(max-width:800px){
  .worker-plan-warehouses{margin-left:0}
  .worker-plan-search{flex:1}
  body.planner-plan-fullscreen .worker-plan-scroll{height:max(260px,calc(100dvh - 235px))}
}
/* Do not let general Production Plan input flex rules stretch staff search. */
body.planner-plan-fullscreen .worker-plan-tools input.worker-plan-search{
  flex:0 1 170px;width:170px;max-width:220px
}
@media(max-width:800px){
  body.planner-plan-fullscreen .worker-plan-tools input.worker-plan-search{flex:1 1 150px}
}

/* Worker Plan: click a worker/week cell to assign a WO already scheduled there. */
.worker-plan-cell{position:relative;cursor:pointer}
.worker-plan-cell:hover{box-shadow:inset 0 0 0 1px var(--blue)}
.worker-plan-cell-add{
  position:absolute;right:5px;bottom:4px;z-index:1;
  display:grid;place-items:center;width:20px;height:20px;
  padding:0;border:1px solid var(--line);border-radius:5px;
  background:var(--surface-raised);color:var(--text);
  opacity:0;cursor:pointer;font:inherit;font-size:17px;line-height:1
}
.worker-plan-cell:hover .worker-plan-cell-add,
.worker-plan-cell-add:focus-visible{opacity:1}
.worker-plan-cell-add:hover{border-color:var(--blue);color:var(--blue)}
.worker-plan-assign-picker{
  position:fixed;z-index:10050;width:min(340px,calc(100vw - 16px));
  max-height:min(450px,80vh);display:flex;flex-direction:column;
  box-sizing:border-box;padding:11px;border:1px solid var(--line);
  border-radius:10px;background:var(--panel);color:var(--text);
  box-shadow:0 14px 40px rgba(0,0,0,.2)
}
.worker-plan-assign-picker *{box-sizing:border-box}
.worker-plan-assign-heading{font-size:12px;font-weight:700;line-height:1.45;margin:0 0 9px}
.worker-plan-assign-search{
  flex:0 0 auto;width:100%;height:34px;padding:6px 9px;
  border:1px solid var(--line);border-radius:7px;
  background:var(--input-bg);color:var(--text);font:inherit;font-size:12px;
  margin:0 0 8px
}
.worker-plan-assign-list{display:flex;flex-direction:column;gap:2px;
  min-height:0;max-height:310px;overflow-y:auto;overflow-x:hidden;padding:2px}
/* Worker Plan picker: chronological WO weeks, with current week in view. */
.worker-plan-assign-week{
  flex:0 0 auto;padding:7px 8px 5px;margin-top:4px;
  border-bottom:1px solid var(--line);font-size:11px;font-weight:700;
  line-height:1.4;color:var(--muted);background:var(--panel)
}
.worker-plan-assign-week.is-current{color:var(--blue)}
.worker-plan-assign-option{display:flex;align-items:center;justify-content:space-between;
  gap:8px;flex:0 0 auto;width:100%;min-width:0;min-height:34px;
  padding:7px 8px;border:0;border-radius:7px;
  background:transparent;color:var(--text);text-align:left;
  cursor:pointer;font:inherit;font-size:12px}
.worker-plan-assign-option:hover,.worker-plan-assign-option:focus-visible{
  background:var(--surface-raised);outline:0;box-shadow:inset 0 0 0 1px var(--blue)
}
.worker-plan-assign-order{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.worker-plan-assign-order strong{font-weight:700}
.worker-plan-assign-warehouse{flex:0 0 auto;color:var(--muted);font-size:11px}
.worker-plan-assign-empty{padding:10px 6px;color:var(--muted);font-size:12px}
.worker-plan-assign-picker.is-saving{pointer-events:none;opacity:.65}
@media(hover:none){.worker-plan-cell-add{opacity:.8}}

/* Settings: Material Alternatives. Separate from iScala-imported tables. */
.planner-alt-panel{max-width:1120px;width:100%;box-sizing:border-box}
.planner-alt-form{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:12px}
.planner-alt-fields{display:grid;grid-template-columns:minmax(125px,1fr) minmax(160px,1.4fr) minmax(125px,1fr) minmax(160px,1.4fr);gap:12px;align-items:start}
.planner-alt-products-field{grid-column:1 / -1}
.planner-alt-field{min-width:0;position:relative;display:flex;flex-direction:column;gap:6px}
.planner-alt-label{color:var(--muted);font-size:11px;font-weight:650}
.planner-alt-combobox{position:relative;min-width:0}
.planner-alt-combobox input{box-sizing:border-box;width:100%;height:34px;border:1px solid var(--line);background:var(--input-bg);color:var(--text);padding:0 9px;border-radius:7px;font-size:12px;outline-offset:1px}
.planner-alt-combobox input:focus{border-color:var(--blue)}
.planner-alt-description{min-height:34px;box-sizing:border-box;display:flex;align-items:center;font-size:12px;overflow-wrap:anywhere;padding:5px 7px;color:var(--text)}
.planner-alt-suggestions{position:absolute;z-index:240;left:0;right:0;top:calc(100% + 3px);max-height:230px;overflow-y:auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 22px rgba(0,0,0,.20);padding:4px}
.planner-alt-suggestions[hidden]{display:none}
.planner-alt-suggestion{display:flex;flex-direction:column;text-align:left;gap:3px;width:100%;border:0;border-radius:5px;background:transparent;color:var(--text);padding:7px 8px;cursor:pointer;font:inherit;min-width:0}
.planner-alt-suggestion strong{font-size:12px}
.planner-alt-suggestion span{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
.planner-alt-suggestion:hover,.planner-alt-suggestion.is-active{background:var(--surface-raised)}
.planner-alt-suggestion-empty{padding:9px;color:var(--muted);font-size:12px}
.planner-alt-chips{display:flex;flex-wrap:wrap;gap:4px;min-height:24px;align-items:center}
.planner-alt-chips-empty{font-size:11px;color:var(--muted)}
.planner-alt-chip,.planner-alt-list-chip{display:inline-flex;align-items:center;gap:5px;background:var(--surface-raised);border:1px solid var(--line);color:var(--text);border-radius:5px;font-size:11px;padding:2px 6px;white-space:nowrap}
.planner-alt-chip button{border:0;padding:0;line-height:1;background:none;color:var(--muted);cursor:pointer;font-size:15px}
.planner-alt-chip button:hover{color:var(--text)}
.planner-alt-form-actions{display:flex;gap:7px;justify-content:flex-end;margin-top:12px}
.planner-alt-panel .planner-alt-save{height:32px;padding:0 12px;background:var(--blue);color:#fff;border-color:var(--blue)}
.planner-alt-panel .planner-alt-cancel{height:32px}
.planner-alt-table-scroll{max-width:100%;overflow-x:auto;margin-top:13px}
.planner-alt-table{width:100%;min-width:910px;border-collapse:collapse;font-size:12px;color:var(--text)}
.planner-alt-table th{text-align:left;white-space:nowrap;padding:9px 10px;font-size:11px;font-weight:650;color:var(--muted);background:var(--surface-raised);border-bottom:1px solid var(--line)}
.planner-alt-table td{padding:8px 10px;vertical-align:middle;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.planner-alt-table td:first-child,.planner-alt-table td:nth-child(3){white-space:nowrap;font-weight:600}
.planner-alt-product-list{max-width:430px}
.planner-alt-list-chip{margin:2px 4px 2px 0}
.planner-alt-row-actions{white-space:nowrap;text-align:right}
.planner-alt-row-actions button{margin-left:5px}
.planner-alt-panel .planner-alt-delete:hover{border-color:#ce555b;color:#ce555b}
.planner-alt-empty{color:var(--muted);font-size:12px;margin:13px 0 0}
@media(max-width:950px){.planner-alt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.planner-alt-fields{grid-template-columns:minmax(0,1fr)}.planner-alt-form{padding:10px}}


/* Synchronization: integrated Admin CSV import and responsive status cards. */
.planner-sync-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:10px;margin:14px 0 24px}
.planner-sync-import-card{max-width:760px;margin:22px 0 24px;padding:20px 22px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text)}
.planner-sync-import-card h1,.planner-sync-import-card h2{margin:0 0 10px;font-size:17px;line-height:1.3;font-weight:750;color:var(--text)}
.planner-sync-import-help{margin:0 0 12px;font-size:13px;line-height:1.55;color:var(--muted)}
.planner-sync-import-warning{margin:0 0 18px;padding:10px 12px;border-radius:8px;background:rgba(224,160,50,.08);border:1px solid rgba(224,160,50,.24);font-size:12px;line-height:1.5;color:var(--text)}
.planner-sync-import-form{display:flex;flex-direction:column;gap:13px;align-items:flex-start}
.planner-sync-import-field{display:flex;flex-direction:column;gap:7px;width:100%;font-size:12px;font-weight:650;color:var(--muted)}
.planner-sync-import-field input[type=file]{display:block;width:100%;max-width:100%;min-height:46px;padding:8px 10px;background:var(--input-bg);border:1px solid var(--line);border-radius:9px;color:var(--text);font-size:13px;line-height:1.7}
.planner-sync-import-field input[type=file]::file-selector-button{margin-right:14px;padding:6px 10px;border:1px solid var(--line);border-radius:7px;background:var(--surface-raised);color:var(--text);font:inherit;cursor:pointer}
.planner-sync-import-submit{min-width:125px;min-height:39px;padding:8px 15px;background:var(--blue);border-color:var(--blue);color:#fff;font-weight:650}
.planner-sync-import-submit:hover:not(:disabled){background:#2667b0;color:#fff}
.planner-sync-import-submit:disabled{opacity:.6}
.planner-sync-import-feedback{margin:0;min-height:18px;font-size:13px;line-height:1.45;color:var(--muted)}
.planner-sync-import-feedback.is-success{color:#47bb7b}
.planner-sync-import-feedback.is-error{color:#e7777d}
.saldoissa-legacy-import{padding:24px 16px;background:var(--bg);color:var(--text)}
.saldoissa-import-layout{max-width:760px;margin:32px auto}
.saldoissa-import-back{display:inline-block;margin-bottom:19px;color:var(--blue);font-size:13px;text-decoration:none}
.saldoissa-import-back:hover{text-decoration:underline}
.saldoissa-legacy-import .planner-sync-import-card{margin:0}
@media(max-width:600px){.planner-sync-import-card{padding:16px}.planner-sync-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Automatic Production account roster and read-only iScala assignments */
.production-iscala-assignments{margin:0 0 22px}
.production-iscala-assignments>h2{font-size:16px;font-weight:700;margin:0 0 10px}
.production-iscala-card{cursor:default;text-align:left;display:flex;align-items:center;justify-content:space-between;max-width:100%}
.production-iscala-card:hover{transform:none}
.production-delete-account{margin-top:12px;color:#e0656a;border-color:#b34d52}
.production-delete-account:hover{background:rgba(215,67,76,.1)}
.planner-emp-legacy{margin-left:6px;font-size:11px;color:var(--muted)}
.planner-emp-form[hidden]{display:none!important}
.field[hidden]{display:none!important}

.planner-emp-field[hidden]{display:none!important}

/* Employees: compact identity columns and in-row production-profile editing.
   Overrides the former separate edit panel without touching other tables. */
.planner-emp-table{
  width:100%;min-width:880px;table-layout:fixed;
}
.planner-emp-table :is(th,td):nth-child(1){width:125px}
.planner-emp-table :is(th,td):nth-child(2){width:145px}
.planner-emp-table :is(th,td):nth-child(3){width:85px}
.planner-emp-table :is(th,td):nth-child(4){width:172px}
.planner-emp-table :is(th,td):nth-child(5){width:22%}
.planner-emp-table :is(th,td):nth-child(7){width:160px}
.planner-emp-table td{vertical-align:middle;overflow-wrap:anywhere}
.planner-emp-table tr.is-editing td{background:var(--surface-raised)}
.planner-emp-table .planner-emp-inline-input{
  display:block;width:100%;min-width:0;max-width:100%;height:34px;
  padding:5px 8px;border:1px solid var(--line);border-radius:8px;
  outline:none;background:var(--input-bg);color:var(--text);
  font:inherit;font-size:12px;box-sizing:border-box;
}
.planner-emp-table .planner-emp-inline-input:focus-visible{
  border-color:var(--focus-ring);box-shadow:0 0 0 2px rgba(115,174,236,.16)
}
.planner-emp-table .planner-emp-row-actions{width:160px;white-space:nowrap;text-align:right}
.planner-emp-table .planner-emp-row-button{min-height:30px;padding:4px 8px}
.planner-emp-inline-message{margin:0 0 10px;min-height:0}
.planner-emp-inline-message[hidden]{display:none!important}

/* Production-only assigned iScala WOs grouped by displayed start week. */
.production-iscala-week{margin:0 0 24px}
.production-iscala-week-title{margin:0 0 10px;padding:0 2px;color:var(--text);font-size:15px;font-weight:750;letter-spacing:.1px}
.production-iscala-week .orders-list{gap:9px}
.production-iscala-card--started,
html[data-theme="dark"] .production-iscala-card--started{
  background:#173e3b;border-color:#3b8e80;color:#d9fff1;
}
.production-iscala-card--started .order-card-number{color:#defef3}
.production-iscala-card--started .order-card-code{color:#b6e4d8}
html[data-theme="light"] .production-iscala-card--started{
  background:#d9f5e9;border-color:#81cab0;color:#174c41;
}
html[data-theme="light"] .production-iscala-card--started .order-card-number{color:#174c41}
html[data-theme="light"] .production-iscala-card--started .order-card-code{color:#356b5e}

/* Read-only iScala WO BOM/Routing card; native Production START/STOP is separate. */
.production-iscala-card{cursor:pointer;font:inherit}
.production-iscala-card:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
.production-iscala-detail{max-width:100%;padding-bottom:28px}
.production-iscala-detail .workorder-card-header{margin-bottom:26px}
.production-iscala-detail .card-progress{justify-content:center}
.production-iscala-detail-section{margin-top:18px;border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:14px}
/* Collapsible read-only WO details: both sections are closed initially. */
.production-iscala-detail-section > summary{display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;font-size:17px;font-weight:800;cursor:pointer;user-select:none;min-height:26px}
.production-iscala-detail-section > summary::-webkit-details-marker{display:none}
.production-iscala-detail-section > summary::after{content:"";width:8px;height:8px;flex:none;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s ease;opacity:.75;margin:0 5px 4px 0}
.production-iscala-detail-section[open] > summary::after{transform:rotate(225deg);margin-bottom:-4px}
.production-iscala-detail-section > summary:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px;border-radius:3px}
.production-iscala-detail-section[open] > .production-iscala-detail-table-wrap{margin-top:14px}
.production-iscala-detail-table-wrap{overflow-x:auto;max-width:100%}
.production-iscala-data-table{width:100%;border-collapse:collapse;font-size:13px;white-space:nowrap}
.production-iscala-data-table th{font-weight:750;color:var(--muted);background:var(--table-head);text-align:left}
.production-iscala-data-table th,.production-iscala-data-table td{padding:10px 9px;border-bottom:1px solid var(--line)}
.production-iscala-data-table tr:last-child td{border-bottom:0}
.production-iscala-data-table td:nth-child(2){white-space:normal;min-width:105px}
.production-iscala-detail-empty{margin:6px 0;color:var(--muted);font-size:14px;line-height:1.5}


/* Production-only training stopwatch: independent of the real iScala WO. */
.production-training-panel{
  display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;
  padding:16px 18px;margin:0 0 20px;border:1px solid var(--line);border-radius:15px;
  background:var(--panel);
}
.production-training-clock{min-width:160px;display:flex;flex-direction:column;gap:4px}
.production-training-time{font-size:35px;font-weight:850;letter-spacing:1px;font-variant-numeric:tabular-nums;line-height:1.2;color:var(--text)}
.production-training-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;flex:1;justify-content:flex-end}
.production-training-button{
  flex:1 1 116px;max-width:170px;min-height:52px;border:0;border-radius:12px;
  color:#fff;font-size:14px;font-weight:850;letter-spacing:.4px;
  transition:filter .14s ease,transform .14s ease,box-shadow .14s ease;
}
.production-training-button:not(:disabled):hover{filter:brightness(1.08);box-shadow:0 3px 12px rgba(0,0,0,.12)}
.production-training-button:not(:disabled):active{transform:translateY(1px)}
.production-training-button:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}
.production-training-button--start{background:#198348;color:#fff}
.production-training-button--pause{background:#eab83d;color:#2c230a}
.production-training-button--stop{background:#c93645;color:#fff}
/* Gray START after STOP is deliberately enabled in this practice mode. */
.production-training-button--restart{background:#78869a;color:#fff;cursor:pointer}
.production-training-button:disabled{opacity:.45;cursor:default;box-shadow:none}
/* Keep the running STOP button visually steady during the 10-second
   background status check. It remains disabled for that brief request,
   preserving protection against overlapping actions. */
.production-training-button--stop:disabled{opacity:1}
.production-training-button--stop:disabled:hover{
  filter:brightness(1.08);box-shadow:0 3px 12px rgba(0,0,0,.12)
}
@media(max-width:560px){
  .production-training-panel{padding:14px;gap:15px}
  .production-training-clock{align-items:center;flex-basis:100%}
  .production-training-actions{width:100%;justify-content:stretch}
  .production-training-button{max-width:none}
}

/* Production WO test timer: app-styled, trilingual STOP confirmation. */
.production-training-finish-dialog{
  width:min(470px,calc(100vw - 32px));max-height:calc(100dvh - 36px);overflow:auto;
  position:fixed;top:calc(env(safe-area-inset-top, 0px) + 18px);bottom:auto;
  margin:0 auto;padding:22px;border:1px solid var(--line);border-radius:18px;
  color:var(--text);background:var(--panel);box-shadow:0 24px 70px rgba(0,0,0,.35);
}
.production-training-finish-dialog::backdrop{background:rgba(4,12,24,.72)}
.production-training-finish-question{display:flex;flex-direction:column;gap:12px;font-size:15px;line-height:1.45}
.production-training-finish-question p{margin:0}
.production-training-finish-question p:first-child{color:var(--muted);font-size:20px;font-weight:500;line-height:1.35}
.production-training-finish-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}
.production-training-finish-actions button{
  min-height:44px;min-width:100px;border-radius:10px;padding:0 16px;font-size:14px;font-weight:750;
}
.production-training-finish-actions button:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}
.production-training-finish-cancel{border:1px solid var(--line);background:var(--surface-raised);color:var(--text)}
.production-training-finish-confirm{border:1px solid transparent;background:#c93645;color:#fff}

/* Dashboard: append-only WO history, initially collapsed. */
.planner-dashboard-wo-log{margin-top:26px;min-width:0}
.planner-wo-log-details{border:1px solid var(--border-color, #cad7e5);border-radius:10px;overflow:hidden}
.planner-wo-log-summary{display:flex;align-items:center;justify-content:space-between;
  gap:12px;cursor:pointer;padding:14px 16px;font-size:15px;font-weight:650;list-style:none}
.planner-wo-log-summary::-webkit-details-marker{display:none}
.planner-wo-log-summary::after{
  content:'';display:block;flex:0 0 8px;width:8px;height:8px;margin-right:4px;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  opacity:.7;transform:rotate(45deg);transition:transform .15s ease
}
.planner-wo-log-details[open]>.planner-wo-log-summary::after{transform:rotate(225deg)}
.planner-wo-log-summary:focus-visible{outline:2px solid #4595db;outline-offset:-3px}
.planner-wo-log-content{border-top:1px solid var(--border-color,#cad7e5);padding:12px 14px 16px}
.planner-wo-log-scroll{max-width:100%;overflow:auto}
.planner-wo-log-table{width:100%;min-width:860px}
.planner-wo-log-table th,.planner-wo-log-table td{white-space:nowrap}
.planner-wo-log-table th{padding:0!important}
.planner-wo-log-sort{
  display:flex;justify-content:space-between;align-items:center;gap:7px;
  border:0;background:transparent;color:inherit;cursor:pointer;
  font:inherit;font-weight:650;text-align:left;width:100%;padding:10px 11px
}
.planner-wo-log-sort::after{content:'↕';font-size:12px;font-weight:500;color:var(--muted);opacity:.65}
.planner-wo-log-table th[aria-sort="ascending"] .planner-wo-log-sort::after{content:'↑';color:var(--blue);opacity:1}
.planner-wo-log-table th[aria-sort="descending"] .planner-wo-log-sort::after{content:'↓';color:var(--blue);opacity:1}
.planner-wo-log-sort:hover{background:var(--surface-raised);color:var(--text)}
.planner-wo-log-sort:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}
.planner-wo-log-table td:nth-child(4){text-align:right}
.planner-wo-log-more{margin-top:12px}

/* Historical Production training sessions (independent of iScala status). */
.planner-worker-time-log-table{width:100%;min-width:670px}
.planner-worker-time-log-table th,.planner-worker-time-log-table td{white-space:nowrap}
.planner-worker-time-in-progress{font-weight:700;color:var(--text)}
.production-training-message{flex-basis:100%;font-size:12px;color:#e1787e;margin-top:4px}

/* Dashboard / Worker Time Log: admin-only test history cleanup. */
.planner-worker-time-action-cell{text-align:right}
.planner-worker-time-delete{
  border:1px solid var(--line);border-radius:8px;padding:5px 10px;
  color:var(--text);background:var(--surface-raised);font-size:12px;font-weight:650;
}
.planner-worker-time-delete:hover{border-color:var(--red);color:var(--red)}
.planner-worker-time-delete:focus-visible,
.planner-worker-time-delete-dialog button:focus-visible{
  outline:2px solid var(--focus-ring);outline-offset:2px
}
.planner-worker-time-delete-dialog{
  width:min(440px,calc(100vw - 32px));margin:auto;padding:22px;
  border:1px solid var(--line);border-radius:16px;
  background:var(--panel);color:var(--text);
  box-shadow:0 24px 72px rgba(0,0,0,.4);
}
.planner-worker-time-delete-dialog::backdrop{background:rgba(4,12,24,.72)}
.planner-worker-time-delete-dialog h3{font-size:18px;margin:0 0 12px}
.planner-worker-time-delete-description{margin:0;color:var(--muted);line-height:1.5}
.planner-worker-time-delete-error{margin:12px 0 0;color:var(--red);font-size:13px}
.planner-worker-time-delete-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.planner-worker-time-delete-actions button{min-height:38px;padding:0 15px}
.planner-worker-time-delete-confirm{
  border:1px solid transparent;border-radius:9px;
  background:#c93645;color:#fff;font-weight:700
}
.planner-worker-time-delete-confirm:disabled{opacity:.6}

/* Employee warehouse multi-choice (WH01 + WH02, or WH60); locale read-only. */
.planner-emp-table{min-width:830px}
.planner-emp-warehouse-options{display:flex;align-items:center;gap:9px;flex-wrap:wrap;min-width:0}
.planner-emp-warehouse-option{display:inline-flex;align-items:center;gap:3px;font-size:12px;cursor:pointer;white-space:nowrap}
.planner-emp-warehouse-option input{margin:0;width:15px;height:15px;accent-color:var(--accent,#347ac3);cursor:pointer}
.planner-emp-table tr.is-editing .planner-emp-warehouse-options{padding:5px 2px}

/* Production: keep the signed-in employee next to LOG OUT on mobile. */
@media(max-width:720px){
  .header-right .user-name{display:block;max-width:min(23vw,95px);overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap;font-size:11px;line-height:1.3;flex:0 1 auto}
  .app-header .header-right{flex-shrink:0;gap:5px}
}
@media(max-width:380px){.header-right .user-name{max-width:55px;font-size:10px}}
/* Interactive iScala Routing, one row per real operation. */
.production-iscala-routing-table td:nth-child(1){white-space:normal;min-width:150px}
.production-iscala-routing-table td:nth-child(2),
.production-iscala-routing-table td:nth-child(3){font-variant-numeric:tabular-nums}
.production-iscala-routing-table tbody tr{cursor:pointer;transition:background-color .12s ease}
.production-iscala-routing-table tbody tr:hover{background:var(--surface-raised)}
.production-iscala-routing-table tbody tr:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}
.production-iscala-routing-table tbody tr.is-selected,
html[data-theme="light"] .production-iscala-routing-table tbody tr.is-selected{background:#c5ead4;color:#13462b}
html[data-theme="dark"] .production-iscala-routing-table tbody tr.is-selected{background:#184d35;color:#e0ffea}
.production-iscala-routing-table tbody tr.is-paused,
html[data-theme="light"] .production-iscala-routing-table tbody tr.is-paused{background:#fff0ac;color:#514015}
html[data-theme="dark"] .production-iscala-routing-table tbody tr.is-paused{background:#6d5214;color:#fff0be}
.production-training-finish-dialog .production-training-finish-qty-heading{
  color:var(--text);font-size:20px;font-weight:800;letter-spacing:0;line-height:1.35;
  overflow-wrap:anywhere
}
.production-training-finish-dialog .production-training-finish-operation{
  color:inherit;font:inherit;letter-spacing:inherit
}
.production-training-finish-dialog .field{display:flex;flex-direction:column;gap:7px;margin-top:10px}
.production-training-finish-dialog .production-training-finish-comment-heading{
  color:var(--text);font-size:20px;font-weight:800;letter-spacing:0;line-height:1.35
}
.production-training-finish-dialog input,
.production-training-finish-dialog textarea{
  width:100%;font-family:inherit;font-size:20px;padding:11px;
  border:1px solid var(--line);border-radius:10px;background:var(--input-bg);color:var(--text)
}
.production-training-finish-dialog textarea{min-height:86px;line-height:1.4;resize:vertical}
.production-training-finish-error{display:block;color:#d14b53;font-size:12px;min-height:1em;margin-top:5px}

.production-iscala-routing-table td:nth-child(2),
.production-iscala-routing-table td:nth-child(3){min-width:0;white-space:nowrap}

/* Production v2: bright running row, mint selected row, amber paused row. */
.production-iscala-routing-table tbody tr.is-running,
html[data-theme="light"] .production-iscala-routing-table tbody tr.is-running,
html[data-theme="light"] .production-iscala-routing-table tbody tr.is-running:hover{
  background:#87e9af;color:#0b4329;box-shadow:inset 4px 0 0 #15965c
}
html[data-theme="dark"] .production-iscala-routing-table tbody tr.is-running,
html[data-theme="dark"] .production-iscala-routing-table tbody tr.is-running:hover{
  background:#258653;color:#f0fff6;box-shadow:inset 4px 0 0 #6ce2a3
}
.production-training-operation{
  max-width:100%;color:var(--muted);font-size:12px;font-weight:700;
  line-height:1.35;overflow-wrap:anywhere
}
.production-training-operation[data-status="running"]{color:#198348}
html[data-theme="dark"] .production-training-operation[data-status="running"]{color:#76e4a4}
.production-training-operation[data-status="paused"]{color:#9b710d}
html[data-theme="dark"] .production-training-operation[data-status="paused"]{color:#f1ce69}
.production-iscala-card-mobile-qty,
.production-iscala-card-mobile-wh{display:none}
@media(max-width:560px){
  #productionIscalaCardView{margin-top:-9px}
  #productionIscalaCardView>.back-button{
    position:absolute;top:0;left:0;z-index:1;
    width:38px;height:38px;margin:0;font-size:22px
  }
  #productionIscalaCardView .workorder-card-header{
    margin:0 0 12px;padding:0 39px;min-height:0
  }
  #productionIscalaCardView .card-label{font-size:20px;line-height:1.25;letter-spacing:.65px}
  #productionIscalaCardView .card-workorder{margin-top:3px;font-size:20px;line-height:1.25}
  #productionIscalaCardView .card-product{margin-top:5px;font-size:20px;line-height:1.25}
  #productionIscalaCardView .card-progress{display:none}
  #productionIscalaCardView .production-iscala-card-mobile-qty{display:inline}
  #productionIscalaCardView .production-iscala-card-mobile-wh{
    display:block;margin-top:4px;color:var(--muted);font-size:13px;font-weight:700;line-height:1.2
  }
  #productionIscalaCardView .production-training-panel{
    padding:11px 13px;margin-bottom:12px;gap:9px
  }
  #productionIscalaCardView .production-training-clock{gap:3px}
  #productionIscalaCardView .production-training-time{font-size:20px}
  #productionIscalaCardView .production-training-actions{gap:8px}
  #productionIscalaCardView .production-training-button{min-height:46px}
  #productionIscalaCardView .production-iscala-detail-section{margin-top:12px;padding:11px 12px}
}

/* Employees: collapsible roster, independent persistent activity / time history. */
.planner-emp-details{margin-bottom:18px}
.planner-emp-details .planner-wo-log-summary .planner-emp-heading{margin:0;font-size:15px}
.planner-emp-list-head{justify-content:flex-end;margin-bottom:8px}
.planner-emp-list-head input{width:min(280px,100%)}
.planner-emp-table{min-width:600px}
.planner-employees-history{min-width:0;margin:0 0 18px}
.planner-employees-history .planner-wo-log-details{background:var(--panel)}
/* Production Activity: compact, fixed header using the standard panel styling. */
.planner-production-activity .planner-production-activity-heading{
  margin:0;padding:10px 16px;cursor:default;align-items:center
}
.planner-production-activity .planner-production-activity-heading::after{content:none}
.planner-production-activity .planner-production-activity-title{
  margin:0;font-size:19px;font-weight:750;line-height:1.25
}
.planner-production-activity .planner-activity-refresh{
  flex:0 0 auto;min-height:34px;padding:6px 12px;font-size:12px;line-height:1.2
}
.planner-production-activity .planner-wo-log-content{padding:10px 14px 12px}

.planner-worker-time-log-table{min-width:1020px}
.planner-worker-log-comment{white-space:normal!important;min-width:190px;max-width:420px;overflow-wrap:anywhere}
.planner-production-activity-table{min-width:870px}
.planner-production-activity-table th,.planner-production-activity-table td{white-space:nowrap}
.planner-production-activity-table td:nth-child(4){white-space:normal;min-width:170px}

/* Production v12: explicit single Start/Stop; operation locked until STOP. */
.production-training-button--idle{background:#8e99a4;color:#fff}
.production-training-button--idle:disabled{opacity:.7}
.production-iscala-routing-table tbody tr[aria-disabled="true"]{cursor:default}
.production-iscala-routing-table tbody tr.is-running[aria-disabled="true"]:hover{background:#87e9af}
html[data-theme="dark"] .production-iscala-routing-table tbody tr.is-running[aria-disabled="true"]:hover{background:#258653}
.production-training-operation{font-family:inherit;font-size:35px;font-weight:850;letter-spacing:1px;line-height:1.2;color:var(--muted)}
.production-training-operation[data-status="running"]{color:#198348}
html[data-theme="dark"] .production-training-operation[data-status="running"]{color:#76e4a4}
/* Keep the original timer/button layout after removing the idle helper text. */
#productionIscalaCardView .production-training-operation{min-height:2.4em}
@media(max-width:560px){
  #productionIscalaCardView .production-training-operation{min-height:1.2em}
}
/* STOP dialog: one typeface, size and weight for all user-facing text. */
.production-training-finish-dialog,
.production-training-finish-dialog p,
.production-training-finish-dialog span,
.production-training-finish-dialog strong,
.production-training-finish-dialog label,
.production-training-finish-dialog input,
.production-training-finish-dialog textarea,
.production-training-finish-dialog button{
  font-family:inherit;font-size:20px;font-weight:500;letter-spacing:normal;line-height:1.35
}
.production-training-finish-dialog .production-training-finish-qty-heading,
.production-training-finish-dialog .production-training-finish-comment-heading,
.production-training-finish-question p:first-child{font-size:20px;font-weight:500}
@media(max-width:560px){
  #productionIscalaCardView .production-training-operation{font-size:20px;letter-spacing:1px}
}


/* Worker Plan: week drag/drop and assignment removal. Keep the existing
   compact card and calendar appearance; do not affect Production Plan. */
.worker-plan-card{position:relative;padding-right:25px}
.worker-plan-card-draggable{cursor:grab;user-select:none}
.worker-plan-card-draggable:active{cursor:grabbing}
.worker-plan-card.worker-plan-dragging{opacity:.55}
/* Keep MTRL ISSUE / MTRL RISK inside the existing card height. The markers
   remain full-size, beside the unassign control instead of growing the row. */
body.planner-plan-fullscreen .worker-plan-card:has(.worker-plan-material-indicators){padding-right:51px}
body.planner-plan-fullscreen .worker-plan-card .worker-plan-material-indicators{
  position:absolute;top:2px;right:25px;margin:0;
}
.worker-plan-card-unassign{
  position:absolute;right:4px;top:4px;display:grid;place-items:center;
  width:17px;height:17px;margin:0;padding:0;border:0;border-radius:4px;
  background:transparent;color:var(--muted);font:600 15px/1 'Segoe UI',Arial,sans-serif;
  cursor:pointer
}
.worker-plan-card-unassign:hover,.worker-plan-card-unassign:focus-visible{
  color:#c6404c;background:var(--surface-raised);outline:1px solid var(--line)
}
.worker-plan-card-unassign:disabled{opacity:.5;cursor:wait}
body.planner-plan-fullscreen .worker-plan-cell.worker-plan-drop-target,
html[data-theme="light"] body.planner-plan-fullscreen .worker-plan-cell.worker-plan-drop-target{
  background:color-mix(in srgb,#3c9f91 19%,var(--panel));
  box-shadow:inset 0 0 0 2px #3c9f91;
}

/* Worker Plan: compact Undo action immediately after the warehouse selector. */
body.planner-plan-fullscreen .worker-plan-tools .worker-plan-undo-move{
  flex:0 0 auto;white-space:nowrap;min-width:66px;
}
body.planner-plan-fullscreen .worker-plan-tools .worker-plan-undo-move:disabled{
  opacity:.43;cursor:default;
}

/* Dispatch: compact read-only table, sharing Saldoissa's Planner surfaces. */
.planner-dispatch-controls{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin:0 0 12px}
.planner-dispatch-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.planner-dispatch-field span{font-size:12px;color:var(--muted);font-weight:650}
.planner-dispatch-field :is(input,select){box-sizing:border-box;height:36px;padding:6px 10px;
  border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--text);font:inherit;font-size:13px}
.planner-dispatch-field select{width:144px}
.planner-dispatch-field input{width:126px}
.planner-dispatch-generate{height:36px;border:0;border-radius:8px;padding:0 16px;
  background:var(--blue);color:#fff;font:inherit;font-size:13px;font-weight:650;cursor:pointer}
.planner-dispatch-generate:disabled{opacity:.55;cursor:wait}
.planner-dispatch-message{font-size:13px;color:var(--muted);margin:0 0 8px}
.planner-dispatch-message:empty{display:none}
.planner-dispatch-summary{font-size:12px;color:var(--muted);margin-bottom:9px}
.planner-dispatch-summary:empty{display:none}
.planner-dispatch-scroll{max-width:100%;overflow-x:auto}
.planner-dispatch-table{width:100%}
.planner-dispatch-table th,.planner-dispatch-table td{padding:8px 11px}
.planner-dispatch-table th:nth-child(1),.planner-dispatch-table td:nth-child(1){width:55px;color:var(--muted);font-weight:450}
.planner-dispatch-table th:nth-child(2){min-width:140px}
.planner-dispatch-table th:nth-child(3){width:100%;min-width:220px}
.planner-dispatch-table th:nth-child(4),.planner-dispatch-table td:nth-child(4){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.planner-dispatch-table th:nth-child(5),.planner-dispatch-table td:nth-child(5){white-space:nowrap}
.planner-dispatch-sort{border:0;padding:0;color:inherit;background:none;font:inherit;font-weight:inherit;cursor:pointer;text-align:inherit}
.planner-dispatch-sort:hover{text-decoration:underline}
.planner-dispatch-table th[aria-sort="ascending"] .planner-dispatch-sort::after{content:' ↑'}
.planner-dispatch-table th[aria-sort="descending"] .planner-dispatch-sort::after{content:' ↓'}
@media(max-width:600px){.planner-dispatch-field select{width:100px}
  .planner-dispatch-field input{width:95px}.planner-dispatch-controls{gap:8px}
  .planner-dispatch-generate{flex:1;min-width:110px}}

/* Work Orders only: sortable headings matching the existing Saldoissa tables. */
.planner-work-orders-table .planner-orders-sort{
  display:inline-flex;align-items:center;gap:5px;
  border:0;background:transparent;padding:0;
  color:inherit;font:inherit;font-weight:inherit;
  text-align:left;white-space:nowrap;cursor:pointer;
}
.planner-work-orders-table .planner-orders-sort:hover{color:var(--text)}
.planner-work-orders-table th[aria-sort="ascending"] .planner-orders-sort::after{content:' ↑';color:var(--blue)}
.planner-work-orders-table th[aria-sort="descending"] .planner-orders-sort::after{content:' ↓';color:var(--blue)}
.planner-work-orders-table .planner-orders-sort:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:2px}

/* Work Order Progress shares the compact Production Activity table styling. */
.planner-work-order-progress{min-width:0;margin:0 0 18px}
.planner-work-order-progress .planner-wo-log-details{background:var(--panel)}
.planner-work-order-progress-table{min-width:720px}
.planner-work-order-progress-table th,.planner-work-order-progress-table td{white-space:nowrap}
.planner-work-order-progress-table .planner-progress-workers{white-space:normal;min-width:180px;max-width:380px;overflow-wrap:anywhere}

/* Work Order Progress v45: compact panels, one shared Refresh, left-aligned data. */
.planner-work-order-progress-page .planner-employees-history{
  margin:0 0 12px;
}
.planner-work-order-progress-page .planner-wo-log-summary,
.planner-work-order-progress-page .planner-production-activity .planner-production-activity-heading{
  padding:9px 14px;
  min-height:52px;
}
.planner-work-order-progress-page .planner-wo-log-content,
.planner-work-order-progress-page .planner-production-activity .planner-wo-log-content{
  padding:9px 12px 11px;
}
.planner-work-order-progress-page .planner-table th,
.planner-work-order-progress-page .planner-table td{
  padding:9px 11px;
  text-align:left;
}
.planner-work-order-progress-page .planner-worker-time-action-cell{
  text-align:left;
}
/* Finished is a quantity: do not inherit the old minimum width for comments. */
.planner-work-order-progress-page .planner-production-activity-table td:nth-child(4){
  min-width:0;
  white-space:nowrap;
}
.planner-work-order-progress-page .planner-production-activity-title{
  font-size:18px;
}
.planner-work-order-progress-page .planner-activity-status{
  font-weight:650;
}
.planner-work-order-progress-page .planner-activity-status--started{color:#208c58}
.planner-work-order-progress-page .planner-activity-status--stopped{color:var(--muted)}
.planner-work-order-progress-page .planner-activity-status--finished{color:#12683a}
html[data-theme="dark"] .planner-work-order-progress-page .planner-activity-status--started{color:#72dca0}
html[data-theme="dark"] .planner-work-order-progress-page .planner-activity-status--finished{color:#54bd82}
@media(max-width:600px){
  .planner-work-order-progress-page .planner-wo-log-summary,
  .planner-work-order-progress-page .planner-production-activity .planner-production-activity-heading{
    padding:9px 12px;
  }
  .planner-work-order-progress-page .planner-wo-log-content,
  .planner-work-order-progress-page .planner-production-activity .planner-wo-log-content{
    padding:8px 10px 10px;
  }
}


/* Work Order Progress v46: minimalist layout without heavy outer cards. */
.planner-work-order-progress-page .planner-wo-log-details{
  border:0;
  border-radius:0;
  background:transparent;
  overflow:visible;
  box-shadow:none;
}
.planner-work-order-progress-page .planner-work-order-progress .planner-wo-log-details,
.planner-work-order-progress-page .planner-production-activity .planner-wo-log-details,
.planner-work-order-progress-page .planner-employees-history .planner-wo-log-details{
  background:transparent;
}
.planner-work-order-progress-page .planner-wo-log-summary,
.planner-work-order-progress-page .planner-production-activity .planner-production-activity-heading{
  background:transparent;
  padding:4px 0 10px;
  min-height:0;
}
.planner-work-order-progress-page .planner-wo-log-content,
.planner-work-order-progress-page .planner-production-activity .planner-wo-log-content{
  border-top:0;
  background:transparent;
  padding:0 0 10px;
}
.planner-work-order-progress-page .planner-table-scroll{
  background:transparent;
  border:0;
  border-radius:0;
}
.planner-work-order-progress-page .planner-employees-history{
  margin:0 0 18px;
}
.planner-work-order-progress-page .planner-worker-time-action-cell{
  padding-right:0;
}
@media(max-width:600px){
  .planner-work-order-progress-page .planner-wo-log-summary,
  .planner-work-order-progress-page .planner-production-activity .planner-production-activity-heading{
    padding:2px 0 8px;
  }
  .planner-work-order-progress-page .planner-wo-log-content,
  .planner-work-order-progress-page .planner-production-activity .planner-wo-log-content{
    padding:0 0 8px;
  }
}


/* Work Order Progress v47: consistent headings and subtle alternating rows. */
.planner-work-order-progress-page .planner-worker-time-log .planner-wo-log-summary > span{
  font-size:18px;
  font-weight:750;
  line-height:1.25;
}
/* Only this page: retain the flat v46 layout and make long logs easier to scan. */
html[data-theme="light"] .planner-work-order-progress-page .planner-table tbody tr:nth-child(odd){
  background:#fff;
}
html[data-theme="light"] .planner-work-order-progress-page .planner-table tbody tr:nth-child(even){
  background:#f4f8fd;
}
html[data-theme="light"] .planner-work-order-progress-page .planner-table tbody tr:hover{
  background:#eaf3fd;
}
html[data-theme="dark"] .planner-work-order-progress-page .planner-table tbody tr:nth-child(odd){
  background:var(--panel);
}
html[data-theme="dark"] .planner-work-order-progress-page .planner-table tbody tr:nth-child(even){
  background:rgba(142,172,204,.075);
}
html[data-theme="dark"] .planner-work-order-progress-page .planner-table tbody tr:hover{
  background:var(--hover-bg);
}

/* v48: Work Order Progress - lightweight, on-demand read-only WO document. */
.planner-work-order-progress-page .planner-progress-wo-link{
  border:0;padding:2px 0;margin:-2px 0;background:transparent;
  color:var(--text);font:inherit;font-weight:600;text-align:left;
  text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;
  cursor:pointer;transition:color .12s ease,text-decoration-color .12s ease;
}
.planner-work-order-progress-page .planner-progress-wo-link:hover{
  color:var(--blue);text-decoration-color:currentColor;
}
.planner-work-order-progress-page .planner-progress-wo-link:focus-visible{
  outline:2px solid var(--focus-ring);outline-offset:3px;border-radius:3px;
}
.planner-progress-dialog{
  box-sizing:border-box;width:min(900px,calc(100vw - 24px));
  max-height:min(90dvh,900px);padding:0;margin:auto;
  border:1px solid var(--line);border-radius:18px;
  background:var(--panel);color:var(--text);
  box-shadow:0 30px 90px rgba(0,0,0,.28);overflow:hidden;
}
.planner-progress-dialog::backdrop{background:rgba(9,22,40,.54)}
.planner-progress-document{display:flex;flex-direction:column;min-height:120px;max-height:min(90dvh,900px)}
.planner-progress-document-bar{
  display:flex;align-items:center;justify-content:space-between;flex:none;gap:14px;
  min-height:52px;box-sizing:border-box;padding:8px 18px;
  border-bottom:1px solid var(--line);
}
.planner-progress-document-label{
  color:var(--muted);font-size:12px;font-weight:750;letter-spacing:.55px;
}
.planner-progress-document-close{
  border:0;background:transparent;color:var(--muted);cursor:pointer;
  display:grid;place-items:center;flex:none;width:34px;height:34px;
  padding:0;border-radius:9px;font-family:inherit;font-size:25px;font-weight:400;line-height:1;
}
.planner-progress-document-close:hover{background:var(--hover-bg);color:var(--text)}
.planner-progress-document-close:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.planner-progress-document-body{overflow-y:auto;min-height:0;padding:18px 24px 26px;overscroll-behavior:contain}
.planner-progress-document-heading{text-align:center;margin:4px 0 22px}
.planner-progress-document-kicker{color:var(--muted);font-size:12px;font-weight:750;letter-spacing:.8px}
.planner-progress-document-number{font-size:27px;font-weight:800;line-height:1.18;margin:8px 0 4px}
.planner-progress-document-product{font-size:18px;font-weight:600;line-height:1.45}
.planner-progress-document-warehouse{color:var(--muted);font-size:14px;margin-top:3px;font-weight:600}
.planner-progress-document-section,
.planner-progress-document-section[open]{
  border:0;border-top:1px solid var(--line);border-radius:0;
  margin:0;padding:15px 0;background:transparent;
}
.planner-progress-document-section > summary{font-size:17px;font-weight:750}
.planner-progress-document-section[open] > .planner-progress-document-scroll{margin-top:12px}
.planner-progress-document-scroll{max-width:100%;overflow-x:auto;border-radius:10px}
.planner-progress-document-scroll .production-iscala-data-table{min-width:640px;font-size:13px}
.planner-progress-document-scroll .production-iscala-data-table th,
.planner-progress-document-scroll .production-iscala-data-table td{
  padding:10px 12px;vertical-align:top;text-align:left;
}
.planner-progress-document-scroll .production-iscala-data-table tbody tr:nth-child(even){
  background:var(--table-head);
}
.planner-progress-document-scroll .production-iscala-data-table td:nth-child(2){
  min-width:70px;white-space:nowrap;
}
.planner-progress-document-scroll .planner-progress-routing-table td:nth-child(4){
  min-width:125px;white-space:normal;
}
.planner-progress-document-scroll .planner-progress-document-comment{
  min-width:150px;max-width:300px;white-space:pre-line;
  overflow-wrap:anywhere;color:var(--text);font-weight:450;
}
.planner-progress-document-empty,
.planner-progress-document-loading,
.planner-progress-document-error{color:var(--muted);font-size:14px;line-height:1.55;margin:12px 0}
.planner-progress-document-error{color:var(--danger,#c63d4b)}
@media(max-width:600px){
  .planner-progress-dialog{width:calc(100vw - 14px);max-height:calc(100dvh - 26px);border-radius:13px}
  .planner-progress-document{max-height:calc(100dvh - 26px)}
  .planner-progress-document-bar{padding:6px 12px;min-height:48px}
  .planner-progress-document-body{padding:14px 13px 18px}
  .planner-progress-document-heading{margin:2px 0 16px}
  .planner-progress-document-number{font-size:23px}
  .planner-progress-document-product{font-size:16px}
}


/* v50: one typographic scale for the WO heading; zebra striping by operation,
   not by individual worker row. Keep BOM striping unchanged. */
.planner-progress-document-kicker,
.planner-progress-document-number,
.planner-progress-document-product{
  font-size:27px;
  font-weight:800;
  line-height:1.2;
  letter-spacing:normal;
}
.planner-progress-document-kicker{color:var(--muted)}
.planner-progress-document-number{margin:5px 0 3px}
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--plain,
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--plain:hover{
  background:var(--panel);
}
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--tinted,
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--tinted:hover{
  background:var(--table-head);
}
/* A rowspan cell and every worker cell share the same operation background. */
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--plain > td{
  background:var(--panel);
}
.planner-progress-document-scroll .planner-progress-routing-table tbody tr.planner-progress-routing-group--tinted > td{
  background:var(--table-head);
}
@media(max-width:600px){
  .planner-progress-document-kicker,
  .planner-progress-document-number,
  .planner-progress-document-product{font-size:23px}
}


/* v51: readable, compact WO header; consistent type size, subtle label. */
.planner-progress-document-kicker,
.planner-progress-document-number,
.planner-progress-document-product{
  font-size:20px;
  font-weight:700;
  line-height:1.3;
  letter-spacing:normal;
}
.planner-progress-document-kicker{color:var(--muted)}
@media(max-width:600px){
  .planner-progress-document-kicker,
  .planner-progress-document-number,
  .planner-progress-document-product{font-size:18px}
}


/* Work Orders: keep column headings visible while the table scrolls.
   The scroll container is scoped to Work Orders, not the shared Dashboard table. */
.planner-work-orders-scroll{
  max-height:calc(100dvh - 210px);
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.planner-work-orders-scroll .planner-work-orders-table thead th{
  position:sticky;
  top:0;
  z-index:3;
  background:var(--table-head);
  box-shadow:0 1px 0 var(--line);
}
@media(max-height:600px){
  .planner-work-orders-scroll{max-height:calc(100dvh - 130px)}
}


/* v53: compact single-code filter in Work Orders, independent from sorting. */
.planner-work-orders-table .planner-orders-code-filter,
.planner-work-orders-table .planner-orders-code-sort{
  display:inline-flex;align-items:center;vertical-align:middle;gap:5px;
  border:0;background:transparent;padding:0;color:inherit;
  font:inherit;font-weight:inherit;cursor:pointer;
}
.planner-work-orders-table .planner-orders-code-filter::after{
  content:'▾';font-size:12px;color:var(--muted);
}
.planner-work-orders-table .planner-orders-code-filter.is-active,
.planner-work-orders-table .planner-orders-code-filter.is-active::after{color:var(--blue)}
.planner-work-orders-table .planner-orders-code-sort{
  margin-left:10px;color:var(--muted);font-size:14px;
}
.planner-work-orders-table .planner-orders-code-filter:hover,
.planner-work-orders-table .planner-orders-code-sort:hover{color:var(--text)}
.planner-work-orders-table .planner-orders-code-filter:focus-visible,
.planner-work-orders-table .planner-orders-code-sort:focus-visible{
  outline:2px solid var(--blue);outline-offset:3px;border-radius:3px;
}
.planner-work-orders-table th[aria-sort="ascending"] .planner-orders-code-sort,
.planner-work-orders-table th[aria-sort="descending"] .planner-orders-code-sort{color:var(--blue)}
.planner-orders-code-menu{
  position:fixed;z-index:1200;box-sizing:border-box;
  background:var(--panel);color:var(--text);
  border:1px solid var(--line);border-radius:12px;
  box-shadow:0 16px 42px rgba(14,27,47,.23);
  padding:9px;display:flex;flex-direction:column;gap:8px;
  max-height:calc(100dvh - 20px);overflow:hidden;
}
.planner-orders-code-menu-heading{display:flex;align-items:center;justify-content:space-between;padding:2px 6px 1px;font-size:13px}
.planner-orders-code-menu-close{border:0;background:transparent;color:var(--muted);font-family:inherit;font-size:20px;font-weight:500;line-height:1;cursor:pointer;padding:3px 7px}
.planner-orders-code-menu-search{box-sizing:border-box;width:100%;height:34px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--text);font:inherit;font-size:13px}
.planner-orders-code-menu-list{min-height:35px;max-height:min(320px,45dvh);overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:2px}
.planner-orders-code-choice{display:block;flex:none;width:100%;text-align:left;border:0;border-radius:7px;background:transparent;color:var(--text);font:inherit;font-size:13px;padding:8px 10px;cursor:pointer}
.planner-orders-code-choice:hover,.planner-orders-code-choice:focus-visible{background:var(--hover-bg)}
.planner-orders-code-choice.is-selected{background:var(--table-head);font-weight:700}
.planner-orders-code-empty{padding:12px 10px;font-size:12px;color:var(--muted)}


.planner-work-orders-table th:has(.planner-orders-sort){white-space:nowrap}


/* Work Orders: a soft mint full-row highlight for already-started WOs.
   Keep the same status test as Production Plan; do not change Dashboard.
   Explicit odd/even and hover rules preserve mint over zebra striping. */
.planner-work-orders-table tbody tr.planner-work-orders-row--started,
.planner-work-orders-table tbody tr.planner-work-orders-row--started:nth-child(even){
  background:#225349;
  color:#e9fff5;
}
.planner-work-orders-table tbody tr.planner-work-orders-row--started:hover,
.planner-work-orders-table tbody tr.planner-work-orders-row--started:nth-child(even):hover{
  background:#2b6659;
}
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--started,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--started:nth-child(even){
  background:#d1efe5;
  color:#234f44;
}
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--started:hover,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--started:nth-child(even):hover{
  background:#bde6d9;
}
.planner-work-orders-table tbody tr.planner-work-orders-row--started td:first-child{
  color:inherit;
}

/* Work Orders v60: dated CO / finished-goods PO entries as full rows,
   matching the soft pink and blue Production Plan order tracks. */
.planner-work-orders-table tbody tr.planner-work-orders-row--customer,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer:nth-child(even){
  background:#fce9f0;
}
.planner-work-orders-table tbody tr.planner-work-orders-row--customer:hover,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer:hover{
  background:#f6d8e5;
}
.planner-work-orders-table tbody tr.planner-work-orders-row--purchase,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase:nth-child(even){
  background:#e6f1fc;
}
.planner-work-orders-table tbody tr.planner-work-orders-row--purchase:hover,
html[data-theme="light"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase:hover{
  background:#d5e8fa;
}
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer,
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer:nth-child(even){
  background:#402c3c;
}
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--customer:hover{
  background:#513449;
}
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase,
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase:nth-child(even){
  background:#24374d;
}
html[data-theme="dark"] .planner-work-orders-table tbody tr.planner-work-orders-row--purchase:hover{
  background:#2f4760;
}


/* Worker Time Log v62: same Code-filter popover styling as Production Plan. */
.planner-work-order-progress-page .planner-worker-filter-trigger{
  display:inline-flex;align-items:center;gap:5px;min-height:24px;
  padding:2px 4px;background:transparent;border:1px solid transparent;
  border-radius:5px;color:inherit;font:inherit;font-weight:750;cursor:pointer;
}
.planner-work-order-progress-page .planner-worker-filter-trigger:hover,
.planner-work-order-progress-page .planner-worker-filter-trigger[aria-expanded="true"]{
  background:var(--surface-raised);border-color:var(--line);
}
.planner-work-order-progress-page .planner-worker-filter-trigger.is-active{color:var(--blue)}
.planner-work-order-progress-page .planner-worker-filter-trigger:focus-visible{
  outline:2px solid var(--blue);outline-offset:1px;
}
.planner-work-order-progress-page .planner-worker-filter-chevron{
  display:inline-block;flex:none;width:0;height:0;margin-left:1px;
  border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid currentColor;opacity:.8;
}
.planner-worker-filter-popover{width:min(316px,calc(100vw - 16px))}
.planner-worker-filter-popover .planner-worker-filter-option{
  display:flex;align-items:center;gap:9px;grid-template-columns:none;
  min-height:33px;padding:4px 8px;
}
.planner-worker-filter-popover .planner-code-filter-code{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* Worker Time Log: manual corrections, using the existing planner surfaces. */
.planner-worker-correction-toolbar{display:flex;justify-content:flex-end;margin:0 0 8px}
.planner-worker-correction-toolbar .planner-simple-button{min-height:32px;padding:5px 12px}
.planner-worker-time-edit{margin-right:6px}
.planner-worker-time-edit.is-corrected::after{content:' ·';color:var(--blue);font-weight:800}
.planner-worker-correction-dialog{width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 28px);margin:auto;padding:0;border:1px solid var(--line);border-radius:14px;color:var(--text);background:var(--panel);box-shadow:0 20px 65px rgba(0,0,0,.26);overflow:auto}
.planner-worker-correction-dialog::backdrop{background:rgba(4,12,24,.55)}
.planner-worker-correction-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 17px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--panel);z-index:1}
.planner-worker-correction-header h2{font-size:18px;margin:0;font-weight:700}
.planner-worker-correction-content{padding:14px 17px 17px}
.planner-worker-correction-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.planner-worker-correction-form .is-wide{grid-column:1/-1}
.planner-worker-correction-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:13px;font-weight:600;color:var(--muted)}
.planner-worker-correction-field :is(input,select,textarea){width:100%;box-sizing:border-box;min-width:0;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:var(--input-bg);color:var(--text);font:inherit;font-weight:400;margin:0;min-height:35px}
.planner-worker-correction-field textarea{resize:vertical;min-height:50px}
.planner-worker-correction-duration{display:flex;align-items:center;justify-content:space-between;padding:8px 10px;background:var(--surface-raised);border-radius:8px;font-size:13px}
.planner-worker-correction-duration strong{font-variant-numeric:tabular-nums;font-size:16px}
.planner-worker-correction-history{font-size:12px;color:var(--muted);padding:5px 0}.planner-worker-correction-history summary{cursor:pointer}.planner-worker-correction-history p{margin:8px 0;overflow-wrap:anywhere}
.planner-worker-correction-error{color:var(--red);font-size:13px;margin:0}.planner-worker-correction-message{color:var(--muted);font-size:13px}
.planner-worker-correction-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:4px}
.planner-worker-correction-actions button{min-height:36px;padding:6px 14px}
.planner-worker-correction-save{border:0;border-radius:8px;background:var(--blue);color:white;font-weight:650;cursor:pointer}.planner-worker-correction-save:disabled{opacity:.5;cursor:wait}
@media(max-width:520px){.planner-worker-correction-form{grid-template-columns:minmax(0,1fr);gap:8px}.planner-worker-correction-content{padding:12px}.planner-worker-correction-header{padding:10px 12px}}


/* v74: Desktop sidebar expand/collapse, like Chrome vertical tabs.
   Mobile keeps the existing horizontal menu; this is visual state only. */
@media (min-width:801px) {
  body.planner-open .planner-view {
    transition: grid-template-columns .2s ease;
    column-gap:12px;
  }
  body.planner-open.planner-sidebar-expanded .planner-view {
    grid-template-columns:224px minmax(0,1fr);
  }
  body.planner-open.planner-sidebar-collapsed .planner-view {
    grid-template-columns:58px minmax(0,1fr);
  }
  body.planner-open .planner-sidebar {
    padding:10px 7px;
    min-width:0;
    border-radius:13px;
  }
  body.planner-open .planner-sidebar-toggle {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    width:100%;
    min-height:37px;
    padding:4px 7px;
    gap:11px;
    margin:0 0 8px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--muted);
    cursor:pointer;
    font:inherit;
    font-size:12px;
    font-weight:600;
    text-align:left;
    position:sticky;
    top:0;
    z-index:3;
    background:var(--panel);
  }
  body.planner-open .planner-sidebar-toggle:hover {
    background:var(--surface-raised);
    color:var(--text);
  }
  body.planner-open .planner-sidebar-toggle:focus-visible,
  body.planner-open .planner-nav-item:focus-visible {
    outline:2px solid var(--blue);
    outline-offset:1px;
  }
  body.planner-open .planner-sidebar-toggle-icon {
    display:flex;
    flex:0 0 32px;
    width:32px;
    height:29px;
    align-items:center;
    justify-content:center;
    font-size:24px;
    line-height:1;
    color:var(--text);
  }
  body.planner-open .planner-sidebar-toggle-icon::before {content:'‹'}
  body.planner-open.planner-sidebar-collapsed .planner-sidebar-toggle-icon::before {content:'›'}
  body.planner-open.planner-sidebar-collapsed .planner-sidebar-toggle {
    justify-content:center;
    gap:0;
    padding:4px 0;
  }
  body.planner-open.planner-sidebar-collapsed .planner-sidebar-toggle-label {display:none}
  body.planner-open .planner-nav {display:grid;gap:4px;overflow:visible}
  body.planner-open .planner-nav-item,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item {
    display:flex;
    align-items:center;
    min-height:38px;
    padding:7px 4px;
    font-size:12px;
    line-height:1.25;
    gap:7px;
    white-space:nowrap;
    text-align:left;
    justify-content:flex-start;
  }
  body.planner-open .planner-nav-item .planner-nav-glyph,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item .planner-nav-glyph {
    display:flex;
    flex:0 0 32px;
    width:32px;
    align-items:center;
    justify-content:center;
    text-align:center;
    white-space:nowrap;
    font-size:10px;
    font-weight:750;
    line-height:1.2;
    letter-spacing:0;
    color:inherit;
  }
  body.planner-open .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph,
  body.planner-open .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph,
  body.planner-open .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph {
    font-size:19px;
    font-weight:500;
  }
  body.planner-open .planner-nav-item .planner-nav-label,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item .planner-nav-label {
    display:inline;
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item {
    justify-content:center;
    padding:8px 0;
    gap:0;
  }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item .planner-nav-label,
  body.planner-plan-fullscreen.planner-sidebar-collapsed .planner-nav-item .planner-nav-label {
    display:none;
  }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item .planner-nav-glyph {
    flex:0 0 auto;
    width:100%;
  }
  body.planner-open.planner-sidebar-collapsed .planner-sidebar-foot {display:none}
  body.planner-open.planner-sidebar-expanded .planner-sidebar-foot {
    display:block;
    margin:14px 4px 0;
    padding-top:12px;
  }
}
@media(max-width:800px) {
  /* Desktop toggle is unnecessary for the mobile horizontal navigation. */
  .planner-sidebar-toggle {display:none}
}
@media(prefers-reduced-motion:reduce) {
  body.planner-open .planner-view {transition:none}
}


/* v75: Expanded desktop navigation displays only the full section names.
   All abbreviations/symbols remain available in the collapsed sidebar. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-expanded .planner-nav-item .planner-nav-glyph,
  body.planner-open.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item .planner-nav-glyph {
    display:none;
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item,
  body.planner-open.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item {
    padding-left:12px;
    padding-right:8px;
    gap:0;
  }
}


/* v77: Isolate the menu toggle from the scrolling list.
   Previously the entire sidebar scrolled and the sticky toggle covered rows.
   On desktop only complete 38px rows (4px gap) enter/leave the menu viewport. */
@media (min-width:801px) {
  body.planner-open .planner-sidebar {
    display:flex;
    flex-direction:column;
    overflow:hidden;
    max-height:calc(100vh - 78px); /* fallback for browsers without dvh */
    max-height:calc(100dvh - 78px);
    overscroll-behavior:contain;
  }
  body.planner-open .planner-sidebar-toggle {
    position:static;
    flex:0 0 37px;
    margin-bottom:8px;
    z-index:auto;
  }
  body.planner-open .planner-nav {
    display:grid;
    grid-auto-rows:38px;
    row-gap:4px;
    flex:0 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior-y:contain;
    scrollbar-width:none;
    -ms-overflow-style:none;
    scroll-snap-type:y mandatory;
    max-height:calc(100vh - 145px);
    max-height:calc(100dvh - 145px);
    /* Fit whole menu rows in the available height, avoiding half-cut labels. */
    max-height:round(down, calc(100dvh - 145px), 42px);
  }
  body.planner-open .planner-nav::-webkit-scrollbar {
    display:none;
    width:0;
  }
  body.planner-open .planner-nav-item,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item {
    height:38px;
    min-height:38px;
    scroll-snap-align:start;
  }
  /* v76 removed the footer text. Do not leave a blank footer occupying space. */
  body.planner-open.planner-sidebar-expanded .planner-sidebar-foot,
  body.planner-open.planner-sidebar-collapsed .planner-sidebar-foot {display:none}
}



/* v79: Lucide-style Dashboard icon. Outline matches other lightweight
   navigation glyphs. Expanded navigation remains text-only (v75).
   No JS, menu registry or accessibility/permission changes. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph,
  body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph {
    font-size:0 !important;
    line-height:0;
  }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph::before,
  body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="dashboard"] .planner-nav-glyph::before {
    content:"";
    display:block;
    width:18px;
    height:18px;
    background:currentColor;
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2212%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2216%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E");
    mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2212%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2216%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E");
    -webkit-mask-position:center;
    mask-position:center;
    -webkit-mask-size:contain;
    mask-size:contain;
    -webkit-mask-repeat:no-repeat;
    mask-repeat:no-repeat;
  }
}


/* v80: consistent outline navigation icons for the chosen Planner sections.
   Keep labels-only expanded desktop navigation and the v79 Dashboard icon.
   Other sections keep their existing abbreviations. No external icon CDN. */
@media (min-width:801px) {
  .planner-nav-item[data-planner-page="plan"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%206h13%22%2F%3E%3Cpath%20d%3D%22M6%2012h9%22%2F%3E%3Cpath%20d%3D%22M11%2018h10%22%2F%3E%3Cpath%20d%3D%22M3%206h1%22%2F%3E%3Cpath%20d%3D%22M3%2012h1%22%2F%3E%3Cpath%20d%3D%22M3%2018h1%22%2F%3E%3C%2Fsvg%3E"); } /* chart-no-axes-gantt */
  .planner-nav-item[data-planner-page="worker-plan"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%202v4M16%202v4M3%2010h18%22%2F%3E%3Cpath%20d%3D%22M8%2014h.01M12%2014h.01M16%2014h.01M8%2018h.01M12%2018h.01M16%2018h.01%22%20stroke-width%3D%223%22%2F%3E%3C%2Fsvg%3E"); } /* calendar-days */
  .planner-nav-item[data-planner-page="work-order-progress"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%228%22%20y%3D%222%22%20width%3D%228%22%20height%3D%224%22%20rx%3D%221%22%2F%3E%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%2F%3E%3Cpath%20d%3D%22m9%2014%202%202%204-4%22%2F%3E%3C%2Fsvg%3E"); } /* clipboard-check */
  .planner-nav-item[data-planner-page="customer-delivery-forecast"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m15.614%207.108-2.115-4.53a1%201%200%200%200-1.329-.484l-2.3%201.073a1%201%200%200%200-.484%201.33l4.783%2010.247a1%201%200%200%200%201.329.483l5.925-2.765a1%201%200%200%200%20.483-1.329l-2.245-4.81a1%201%200%200%200-1.329-.484l-6.831%203.188%22%2F%3E%3Cpath%20d%3D%22M2%203.268a2%202%200%200%201%202.812.886l7%2015a2%202%200%200%200%202.659.967L20%2017.54%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2220%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E"); } /* hand-truck */
  .planner-nav-item[data-planner-page="stock"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2012V9a1%201%200%200%200-1-1H9a1%201%200%200%200-1%201v3%22%2F%3E%3Cpath%20d%3D%22M16%2020v-3a1%201%200%200%200-1-1h-2a1%201%200%200%200-1%201v3%22%2F%3E%3Cpath%20d%3D%22M20%2022V2%22%2F%3E%3Cpath%20d%3D%22M4%2012h16%22%2F%3E%3Cpath%20d%3D%22M4%2020h16%22%2F%3E%3Cpath%20d%3D%22M4%202v20%22%2F%3E%3Cpath%20d%3D%22M4%204h16%22%2F%3E%3C%2Fsvg%3E"); } /* shelving-unit */
  .planner-nav-item[data-planner-page="price"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%209.4a4%204%200%201%200%200%205.2%22%2F%3E%3Cpath%20d%3D%22M7%2012h5%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3C%2Fsvg%3E"); } /* tags */
  .planner-nav-item[data-planner-page="employees"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M22%2021v-2a4%204%200%200%200-3-3.87M16%203.13a4%204%200%200%201%200%207.75%22%2F%3E%3C%2Fsvg%3E"); } /* users */
  .planner-nav-item[data-planner-page="dispatch"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10%2017h4V5H2v12h3%22%2F%3E%3Cpath%20d%3D%22M14%209h4l4%204v4h-3%22%2F%3E%3Ccircle%20cx%3D%227.5%22%20cy%3D%2217.5%22%20r%3D%222.5%22%2F%3E%3Ccircle%20cx%3D%2216.5%22%20cy%3D%2217.5%22%20r%3D%222.5%22%2F%3E%3C%2Fsvg%3E"); } /* truck */
  .planner-nav-item[data-planner-page="settings"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%207h9M19%207h1M4%2017h1M11%2017h9%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%227%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2217%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E"); } /* settings-2 */
  .planner-nav-item[data-planner-page="sync"] { --saldoissa-section-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2011a8%208%200%200%200-14-5L4%208%22%2F%3E%3Cpath%20d%3D%22M4%204v4h4%22%2F%3E%3Cpath%20d%3D%22M4%2013a8%208%200%200%200%2014%205l2-2%22%2F%3E%3Cpath%20d%3D%22M20%2020v-4h-4%22%2F%3E%3C%2Fsvg%3E"); } /* refresh-cw */
  body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="worker-plan"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="work-order-progress"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="customer-delivery-forecast"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="stock"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="price"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="employees"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="dispatch"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph,
  body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="worker-plan"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="work-order-progress"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="customer-delivery-forecast"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="stock"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="price"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="employees"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="dispatch"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph { font-size:0 !important;line-height:0; }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="worker-plan"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="work-order-progress"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="customer-delivery-forecast"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="stock"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="price"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="employees"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="dispatch"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph::before,body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph::before,
  body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="worker-plan"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="work-order-progress"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="customer-delivery-forecast"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="stock"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="price"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="employees"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="dispatch"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="settings"] .planner-nav-glyph::before,body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="sync"] .planner-nav-glyph::before {
    content:"";
    display:block;
    flex:0 0 auto;
    width:18px;
    height:18px;
    background:currentColor;
    -webkit-mask:var(--saldoissa-section-icon) center / contain no-repeat;
    mask:var(--saldoissa-section-icon) center / contain no-repeat;
  }
}
/* The Admin header control is the entry point for Administration.
   Align the shield-check with other compact header actions. */
#adminTabButton:not([hidden]) {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:6px;
}
#adminTabButton:not([hidden])::before {
  content:"";
  display:inline-block;
  width:16px;
  height:16px;
  flex:0 0 16px;
  background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2022s8-4%208-10V5l-8-3-8%203v7c0%206%208%2010%208%2010Z%22%2F%3E%3Cpath%20d%3D%22m9%2012%202%202%204-4%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2022s8-4%208-10V5l-8-3-8%203v7c0%206%208%2010%208%2010Z%22%2F%3E%3Cpath%20d%3D%22m9%2012%202%202%204-4%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
}


/* v81: Keep Lucide icons visible beside labels when the desktop sidebar expands.
   Abbreviations (CO/PO/WO) stay hidden in expanded mode to avoid duplication.
   Collapse and mobile behavior are unchanged. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-expanded .planner-view {
    grid-template-columns:270px minmax(0, 1fr);
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is([data-planner-page="dashboard"],[data-planner-page="plan"],[data-planner-page="worker-plan"],[data-planner-page="work-order-progress"],[data-planner-page="customer-delivery-forecast"],[data-planner-page="stock"],[data-planner-page="price"],[data-planner-page="employees"],[data-planner-page="dispatch"],[data-planner-page="settings"],[data-planner-page="sync"]) {
    display:flex;
    align-items:center;
    gap:8px;
    padding-left:5px;
    padding-right:8px;
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is([data-planner-page="dashboard"],[data-planner-page="plan"],[data-planner-page="worker-plan"],[data-planner-page="work-order-progress"],[data-planner-page="customer-delivery-forecast"],[data-planner-page="stock"],[data-planner-page="price"],[data-planner-page="employees"],[data-planner-page="dispatch"],[data-planner-page="settings"],[data-planner-page="sync"]) .planner-nav-glyph {
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 32px;
    width:32px;
    height:22px;
    font-size:0 !important;
    line-height:0;
  }
  /* Rows without a selected Lucide icon keep the same text baseline. */
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is([data-planner-page="customer-orders"], [data-planner-page="purchases"], [data-planner-page="orders"]) {
    padding-left:45px;
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item[data-planner-page="dashboard"] {
    --saldoissa-section-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2212%22%20width%3D%227%22%20height%3D%229%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2216%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E");
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is([data-planner-page="dashboard"],[data-planner-page="plan"],[data-planner-page="worker-plan"],[data-planner-page="work-order-progress"],[data-planner-page="customer-delivery-forecast"],[data-planner-page="stock"],[data-planner-page="price"],[data-planner-page="employees"],[data-planner-page="dispatch"],[data-planner-page="settings"],[data-planner-page="sync"]) .planner-nav-glyph::before {
    content:"";
    display:block;
    flex:0 0 18px;
    width:18px;
    height:18px;
    background:currentColor;
    -webkit-mask:var(--saldoissa-section-icon) center / contain no-repeat;
    mask:var(--saldoissa-section-icon) center / contain no-repeat;
  }
}


/* v82: Show CO, PO and WO beside their full labels in the expanded menu.
   Align these abbreviations with the 32px Lucide icon column.
   Collapsed sidebar and mobile navigation retain their previous behavior. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is(
    [data-planner-page="customer-orders"],
    [data-planner-page="purchases"],
    [data-planner-page="orders"]
  ) {
    display:flex;
    align-items:center;
    gap:8px;
    padding-left:5px;
    padding-right:8px;
  }
  body.planner-open.planner-sidebar-expanded .planner-nav-item:is(
    [data-planner-page="customer-orders"],
    [data-planner-page="purchases"],
    [data-planner-page="orders"]
  ) .planner-nav-glyph {
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 32px;
    width:32px;
    height:22px;
    font-size:11px;
    font-weight:750;
    line-height:1;
    letter-spacing:0;
  }
}


/* v84: Production Plan uses its native PP abbreviation instead of the Lucide Gantt
   icon. Keep the same icon-column alignment in both desktop sidebar states. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-collapsed .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph,
  body.planner-open.planner-sidebar-expanded .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph,
  body.planner-plan-fullscreen:not(.planner-sidebar-expanded) .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph {
    font-size:11px !important;
    line-height:1.25 !important;
    font-weight:750;
    letter-spacing:0;
  }
  body.planner-open .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph::before,
  body.planner-plan-fullscreen .planner-nav-item[data-planner-page="plan"] .planner-nav-glyph::before {
    content:none !important;
    display:none !important;
  }
}


/* v85: Dashboard tables use one consistent left-aligned column layout.
   Keep this scoped to the four requested Dashboard tables, not CDF/Work Orders. */
.planner-dashboard .planner-dashboard-started-table th,
.planner-dashboard .planner-dashboard-started-table td,
.planner-dashboard .planner-dashboard-backlog-table th,
.planner-dashboard .planner-dashboard-backlog-table td,
.planner-dashboard .planner-dashboard-completion-table th,
.planner-dashboard .planner-dashboard-completion-table td,
.planner-dashboard .planner-wo-log-table th,
.planner-dashboard .planner-wo-log-table td {
  text-align:left !important;
}
.planner-dashboard .planner-dashboard-started-table th:last-child,
.planner-dashboard .planner-dashboard-started-table td:last-child {
  min-width:145px;
  max-width:320px;
  white-space:normal;
  overflow-wrap:anywhere;
}
.planner-dashboard .planner-dashboard-started-table td:last-child {
  color:var(--text);
  font-weight:450;
}

/* v89: Dispatch uses the shared Production Plan ISO-week calendar instead of
   separate numeric week/year fields. */
.planner-dispatch-field .planner-dispatch-week-picker {
  height:36px;
  min-width:205px;
  box-sizing:border-box;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--input-bg);
  color:var(--text);
  font-size:13px;
  justify-content:flex-start;
}
.planner-dispatch-field .planner-dispatch-week-picker:hover{border-color:var(--blue)}
.planner-dispatch-field .planner-dispatch-week-picker:focus-visible{
  outline:2px solid var(--focus-ring);outline-offset:2px;
}


/* v90: Dispatch material stock availability, Excel and fixed table header. */
.planner-dispatch-excel{height:36px;min-width:74px;padding:0 16px;font-size:13px}
.planner-dispatch-excel:disabled{opacity:.4;cursor:default}
.planner-dispatch-scroll{
  max-height:max(240px,calc(100dvh - 300px));
  overflow:auto;
  overscroll-behavior:contain;
}
.planner-dispatch-table{min-width:900px;width:100%;border-collapse:separate;border-spacing:0}
.planner-dispatch-table th,.planner-dispatch-table td{white-space:nowrap}
.planner-dispatch-table th:nth-child(3){width:auto;min-width:225px}
.planner-dispatch-table th:nth-child(4),.planner-dispatch-table td:nth-child(4),
.planner-dispatch-table th:nth-child(5),.planner-dispatch-table td:nth-child(5),
.planner-dispatch-table th:nth-child(6),.planner-dispatch-table td:nth-child(6){
  text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.planner-dispatch-table th:nth-child(7),.planner-dispatch-table td:nth-child(7){
  white-space:nowrap;
}
.planner-dispatch-table thead th{
  position:sticky;top:0;z-index:2;
  background:var(--table-head);
  box-shadow:0 1px 0 var(--line);
}


/* v93: Scroll the Dashboard WO Time Log independently and keep its sortable header visible. */
.planner-dashboard .planner-wo-log-scroll {
  max-height:560px;
  max-height:min(560px,65dvh);
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.planner-dashboard .planner-wo-log-table {
  border-collapse:separate;
  border-spacing:0;
}
.planner-dashboard .planner-wo-log-table thead th {
  position:sticky;
  top:0;
  z-index:2;
  background:var(--table-head);
  box-shadow:0 1px 0 var(--line);
}

/* v96: Dispatch WO product codes. Preserve Unit as the final column. */
.planner-dispatch-table{min-width:1110px}
.planner-dispatch-table th:nth-child(4),.planner-dispatch-table td:nth-child(4){
  text-align:left;white-space:normal;font-variant-numeric:normal;
  min-width:165px;max-width:310px;overflow-wrap:anywhere;
}
.planner-dispatch-table th:nth-child(5),.planner-dispatch-table td:nth-child(5),
.planner-dispatch-table th:nth-child(6),.planner-dispatch-table td:nth-child(6),
.planner-dispatch-table th:nth-child(7),.planner-dispatch-table td:nth-child(7){
  text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.planner-dispatch-table th:nth-child(8),.planner-dispatch-table td:nth-child(8){
  text-align:left;white-space:nowrap;font-variant-numeric:normal;
}


/* v97: Compact on-demand Refresh beside Logout, above Last update.
   Does not affect browser caching until explicitly clicked. */
.header-session-buttons{display:flex;align-items:center;gap:6px;justify-content:flex-end}
.header-session-buttons .header-action{white-space:nowrap}
@media (max-width:560px){
  .header-session-buttons{gap:4px}
  .header-session-buttons .header-action{padding-inline:6px;font-size:9px}
}

/* v98: The Saldoissa mark performs the existing on-demand cache-busting refresh.
   The wordmark still opens the home screen. No extra reloads or cache disabling. */
.app-header .header-brand-group{gap:8px}
.app-header .brand-logo-refresh{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:inherit;
  line-height:1;
  cursor:pointer;
  touch-action:manipulation;
}
.app-header .brand-logo-refresh:hover{opacity:.82}
.app-header .brand-logo-refresh:focus-visible{
  outline:2px solid var(--focus-ring);
  outline-offset:3px;
}


/* v102: Worker Plan operation started in Saldoissa, not yet started in iScala.
   Use an inset accent so card geometry, drag-and-drop and comments do not move.
   The regular full-green .is-started state always takes priority. */
.worker-plan-card.is-worker-started:not(.is-started){
  box-shadow:inset 0 -3px 0 #519ca6;
}
html[data-theme="light"] .worker-plan-card.is-worker-started:not(.is-started){
  box-shadow:inset 0 -3px 0 #74b4bb;
}


/* v103: Production Plan shares Worker Plan's Saldoissa-only start cue.
   A log entry adds a bottom accent only until iScala marks that WO started.
   Overlay line does not change card size, selection/drop shadows or Σ text. */
body.planner-plan-fullscreen .planner-timeline .planner-timeline-chip.planner-timeline-chip--worker-started:not(.planner-timeline-chip--started),
.planner-wo-picker-item.planner-wo-picker-item--worker-started:not(.planner-wo-picker-item--started){
  position:relative;
}
body.planner-plan-fullscreen .planner-timeline .planner-timeline-chip.planner-timeline-chip--worker-started:not(.planner-timeline-chip--started)::after,
.planner-wo-picker-item.planner-wo-picker-item--worker-started:not(.planner-wo-picker-item--started)::after{
  content:"";
  position:absolute;
  left:3px;
  right:3px;
  bottom:0;
  height:3px;
  background:#519ca6;
  border-radius:2px;
  pointer-events:none;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline .planner-timeline-chip.planner-timeline-chip--worker-started:not(.planner-timeline-chip--started)::after,
html[data-theme="light"] .planner-wo-picker-item.planner-wo-picker-item--worker-started:not(.planner-wo-picker-item--started)::after{
  background:#74b4bb;
}


/* v105: Sidebar stays usable after Production Plan week redraws.
   Do not round the list viewport or force scroll-snap while browser layout
   changes. Keep the toggle outside the independent, discoverable scroll area. */
@media (min-width:801px) {
  body.planner-open .planner-sidebar {
    overflow-anchor:none;
  }
  body.planner-open .planner-nav {
    max-height:calc(100vh - 145px);
    max-height:calc(100dvh - 145px);
    scroll-snap-type:none;
    overflow-anchor:none;
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:var(--line) transparent;
    padding-bottom:4px;
  }
  body.planner-open .planner-nav-item {
    scroll-snap-align:none;
  }
  body.planner-open .planner-nav::-webkit-scrollbar {
    display:block;
    width:6px;
  }
  body.planner-open .planner-nav::-webkit-scrollbar-thumb {
    background:var(--line);
    border-radius:6px;
  }
}


/* v106: Compact, reliably scrollable planner sidebar.
   The old 270px-wide rail and 38px+4px rows overflowed short viewports,
   particularly at increased browser zoom. Keep the toggle separate from
   the scrolling navigation; never clip its final entries. */
@media (min-width:801px) {
  body.planner-open.planner-sidebar-expanded .planner-view {
    grid-template-columns:242px minmax(0,1fr);
  }
  body.planner-open .planner-sidebar {
    position:sticky;
    top:74px;
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    padding:8px 7px;
    min-height:0;
    max-height:calc(100vh - 86px);
    max-height:calc(100dvh - 86px);
    overflow:hidden;
  }
  body.planner-open .planner-sidebar-toggle {
    position:relative;
    top:auto;
    flex:0 0 34px;
    min-height:34px;
    margin:0 0 5px;
    padding:3px 5px;
  }
  body.planner-open .planner-nav {
    display:grid;
    grid-auto-rows:32px;
    gap:2px;
    flex:0 1 auto;
    min-height:0;
    max-height:none;
    padding:0 3px 0 0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    scroll-snap-type:none;
    scrollbar-width:thin;
    scrollbar-color:var(--line) transparent;
  }
  body.planner-open .planner-nav-item,
  body.planner-plan-fullscreen.planner-sidebar-expanded .planner-nav-item {
    height:32px;
    min-height:32px;
    padding-top:4px;
    padding-bottom:4px;
    border-radius:9px;
    scroll-snap-align:none;
  }
  body.planner-open .planner-nav-item:focus-visible {
    outline-offset:-2px;
  }
  body.planner-open .planner-nav-item .planner-nav-label {
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.planner-open .planner-nav::-webkit-scrollbar {display:block;width:5px}
  body.planner-open .planner-nav::-webkit-scrollbar-thumb {
    background:var(--line);
    border-radius:5px;
  }
  body.planner-open.planner-sidebar-collapsed .planner-nav-item {
    padding-top:4px;
    padding-bottom:4px;
  }
}


/* v109: SC11 confirmation display. Unconfirmed CO quantities use gray text
   without changing chip/cell backgrounds. Unknown and confirmed keep normal
   colors. The CO breakdown also uses gray text without dimming its row. */
body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co
.planner-pp-co-qty.planner-pp-co-qty--unconfirmed{
  color:#9aa9b9;
}
html[data-theme="light"] body.planner-plan-fullscreen .planner-timeline--weeks.planner-pp-with-co
.planner-pp-co-qty.planner-pp-co-qty--unconfirmed{
  color:#7b8795;
}
body.planner-plan-fullscreen .planner-pp-co-picker-item--unconfirmed{
  color:var(--muted);
}
