:root{--blue:#0d43c8;--nav:#0a39b6;--ink:#192b4a;--muted:#66768f;--line:#d9e2ed;--canvas:#f4f7fb;--accent:#0964dc}*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Segoe UI,Arial,sans-serif;background:var(--canvas);color:var(--ink)}button,select,input,textarea{font:inherit}a{color:var(--accent)}.app-shell{display:flex;min-height:100vh}.app-nav{flex:0 0 230px;width:230px;background:var(--nav);color:#fff;transition:width .2s,flex-basis .2s;overflow:hidden;z-index:2}.app-brand{height:76px;padding:18px 15px;display:flex;align-items:center;gap:12px;font-size:21px;font-weight:750}.brand-symbol{color:#cde8ff;font-size:25px}.brand-title small{display:block;font-size:10px;opacity:.8;letter-spacing:.5px}.app-nav-links{overflow-y:auto;max-height:calc(100vh - 80px)}.app-nav-item{color:#e8efff;display:flex;text-decoration:none;align-items:center;gap:11px;padding:11px 17px;font-weight:550;font-size:13px;white-space:nowrap}.app-nav-item:hover,.app-nav-item.active{color:white;background:#235cdd}.nav-icon{display:grid;place-items:center;font-weight:800;width:26px;height:25px;border-radius:6px;background:#ffffff22}.app-shell.collapsed .app-nav{flex-basis:63px;width:63px}.app-shell.collapsed .nav-label,.app-shell.collapsed .brand-title{display:none}.app-main{flex:1;min-width:0}.app-top{height:76px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 22px}.icon-button{border:0;background:transparent;color:var(--nav);cursor:pointer;font-size:23px}.page-title{font-size:20px;margin:0;font-weight:650}.top-grow{flex:1}.company-switch select{min-width:190px;max-width:290px;border:1px solid var(--line);padding:7px;border-radius:5px;background:#fff}.user-label{font-size:12px;font-weight:650}.logout-btn{background:white;border:1px solid var(--line);border-radius:5px;padding:8px 11px;cursor:pointer;color:var(--blue)}.app-content{padding:23px;max-width:1800px;margin:auto}.page-intro{display:flex;align-items:center;justify-content:space-between;margin:2px 0 18px}.page-intro h2{margin:0 0 6px;font-size:23px}.page-intro p{margin:0;color:var(--muted);font-size:13px}.panel{background:#fff;border:1px solid var(--line);border-radius:8px;padding:17px;margin-bottom:18px;box-shadow:0 2px 8px #122c4b0b}.panel h3{font-size:17px;margin:0 0 12px}.grid-panel{position:relative}.grid-search{margin:11px 0;display:flex;justify-content:flex-end}.grid-search input{width:240px;border:1px solid var(--line);padding:8px;border-radius:5px}.field-grid{height:510px;width:100%}.small-grid{height:275px}.dashboard-table{height:325px}.detail-toolbar{margin-top:14px}.details-panel{margin-top:14px}.details-panel #detailTitle{padding-bottom:8px}.window-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.window-actions button,.primary{border:1px solid #ccd7e8;padding:9px 17px;background:#fff;border-radius:5px;cursor:pointer}.window-actions .primary,.primary{background:var(--blue);border-color:var(--blue);color:white}.form-row{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:12px;margin:10px 0}.form-row label{font-size:13px;font-weight:600}.form-row input,.form-row textarea,.form-row select{width:100%;min-width:0;border:1px solid var(--line);padding:7px;border-radius:4px}.form-error{color:#ba2c32;font-size:13px;margin:11px 0}.notice{padding:9px;background:#fff3ce;border:1px solid #f0d188;border-radius:5px}.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:18px}.kpi{background:white;border:1px solid var(--line);padding:22px;border-radius:8px}.kpi .number{font-size:32px;font-weight:750;color:var(--blue)}.kpi .label{font-size:13px;color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:1fr 1.4fr;gap:15px}.login-page{background:linear-gradient(135deg,#0834aa,#4195ed);min-height:100vh;display:grid;place-items:center}.login-card{background:white;border-radius:13px;box-shadow:0 15px 45px #0003;width:min(405px,95vw);padding:36px}.login-brand{font-size:30px;font-weight:bold;color:#0a39b6}.login-card h2{margin:23px 0 4px}.login-card p{color:#777;margin-bottom:25px}.login-card label:not(.remember){display:block;font-weight:600;font-size:13px;margin:14px 0 5px}.login-card input:not([type=checkbox]){width:100%;border:1px solid var(--line);border-radius:4px;padding:12px}.login-card .remember{display:block;margin:15px 0}.login-card .primary{width:100%;margin-top:8px}.k-window-content{padding:16px!important}.ag-row-selected{background:#e5f1ff!important}

/* Single, dependable desktop/mobile sidebar: Kendo widgets never reparent the app. */
.app-shell { display:flex; width:100%; min-height:100vh; min-width:0; align-items:stretch; }
.app-nav { flex:0 0 230px; width:230px; min-width:0; background:#0a39b6 !important; color:#fff !important; }
.app-nav-list { margin:0; padding:0; list-style:none; }
.app-nav-entry { margin:0; padding:0; list-style:none; }
.app-nav .app-nav-item, .app-nav .nav-label { color:#eaf1ff !important; }
.app-nav .app-nav-item { width:100%; min-height:45px; font-weight:600; }
.app-nav .app-nav-item:hover, .app-nav .app-nav-item:focus-visible,
.app-nav .app-nav-item.active, .app-nav-entry.active > .app-nav-item {
  color:white !important; background:#2460de !important;
}
.app-nav .app-nav-item:hover .nav-label, .app-nav .app-nav-item.active .nav-label,
.app-nav-entry.active .nav-label { color:white !important; }
.app-nav .nav-icon { flex:0 0 26px; color:white !important; }
.app-nav .app-brand, .app-nav .brand-title { color:white !important; }
.app-nav-links { overflow-x:hidden; overflow-y:auto; max-height:calc(100vh - 76px); }
.app-main { flex:1 1 0; min-width:0; width:auto; background:var(--canvas); }
.app-top { width:100%; min-width:0; }
.app-content { min-width:0; width:100%; max-width:1800px; }
.app-content .panel, .app-content .field-grid { min-width:0; max-width:100%; }
.dashboard-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); }
.app-shell.collapsed .app-nav { flex:0 0 63px; width:63px; }
.app-shell.collapsed .app-nav-item { justify-content:center; padding-left:0; padding-right:0; }
.app-shell.collapsed .app-brand { justify-content:center; padding-left:0; padding-right:0; }
.app-shell.collapsed .brand-title, .app-shell.collapsed .nav-label { display:none !important; }
.page-intro { gap:15px; flex-wrap:wrap; }
.company-switch { min-width:0; }
#scheduler { width:100%; min-width:0; }
#scheduler .k-scheduler-toolbar { flex-wrap:wrap; }
@media (max-width:1120px) {
  .dashboard-grid { grid-template-columns:minmax(0,1fr); }
  .app-top { gap:10px; padding-inline:12px; }
}
@media (max-width:900px) {
  /* Do not force sidebar into mini mode: the toggle controls it. */
  .app-shell:not(.collapsed) .app-nav { flex:0 0 230px; width:230px; }
  .app-shell:not(.collapsed) .app-nav .nav-label,
  .app-shell:not(.collapsed) .app-nav .brand-title { display:block !important; }
  .app-shell:not(.collapsed) .app-nav-item { justify-content:flex-start; padding:11px 17px; }
  .app-shell:not(.collapsed) .app-brand { justify-content:flex-start; padding:18px 15px; }
  .app-shell.collapsed .app-nav { flex:0 0 63px; width:63px; }
  .app-content { padding:12px; }
  .app-top .page-title { font-size:17px; }
}
@media (max-width:580px) {
  .app-content { padding:9px; }
  .app-top { gap:6px; padding-inline:8px; }
  .app-top .user-label { display:none; }
  .company-switch select { min-width:95px; max-width:150px; }
  .kpi-row { gap:8px; }
  .kpi { padding:12px; }
}

/* Stage 3: reusable child tab grids */
.details-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.details-heading p{margin:0 0 12px;color:var(--muted);font-size:12px}
.detail-tab-pane{min-width:0;padding:12px 0}
.details-panel .k-tabstrip-content{min-width:0;overflow:hidden}
.details-panel .field-grid{min-width:0}
.detail-fallback-tabs{list-style:none;display:flex;gap:10px;flex-wrap:wrap;padding:0;margin:0 0 12px;border-bottom:1px solid var(--line)}
.detail-fallback-tabs li{padding:10px 12px;cursor:pointer;border-radius:5px 5px 0 0;color:var(--accent)}
.detail-fallback-tabs li.k-active{background:#e5f0ff;font-weight:700}
@media(max-width:900px){.small-grid{height:340px}.details-heading{display:block}}

/* Stage 4: quote/invoice/purchase documents share one AG Grid + Kendo detail editor. */
.document-panel{min-width:0}.document-panel #docHint{color:var(--muted);font-size:13px}
.document-panel .small-grid{height:300px;min-width:0;margin-top:12px}
.document-panel #docToolbar{margin:10px 0}.document-totals{font-weight:700;white-space:pre-wrap;
    line-height:1.8;text-align:right;margin:14px 0;padding:10px 14px;background:#f1f6ff;border-radius:5px}
.document-payments-label{margin-top:22px!important}.document-popup .form-row{grid-template-columns:155px minmax(0,1fr)}
@media(max-width:760px){.document-popup .form-row{grid-template-columns:1fr}.document-totals{text-align:left}}

/* Stage 4B – independent, responsive inventory/receiving/costing panels. */
.stock-panel { margin-top: 18px; min-width: 0; }
.stock-panel h3, .stock-panel h4 { margin: 8px 0 12px; }
.stock-toolbar { display:flex; flex-wrap:wrap; gap: 8px; margin: 12px 0; }
.stock-toolbar .k-button, .stock-toolbar button { min-height: 34px; }
.stock-summary { display:flex; flex-wrap:wrap; gap: 12px; margin: 14px 0; }
.stock-metric { min-width: 130px; background:#f1f6ff; border:1px solid #d9e6fb; border-radius:6px; padding:9px 14px; }
.stock-metric span {display:block;font-size:12px;color:#456080;}
.stock-metric strong {font-size:17px;color:#1641a4;}
.stock-dialog-fields { display:grid;gap:12px;min-width:0; }
.stock-dialog-fields label { display:block;font-weight:600;font-size:13px; }
.stock-dialog-fields input, .stock-dialog-fields select, .stock-dialog-fields textarea {box-sizing:border-box;width:100%;max-width:100%;margin-top:4px;}
.stock-dialog-actions {display:flex;justify-content:flex-end;gap:9px;margin-top:20px;}
@media(max-width:760px){.stock-metric{min-width:calc(50% - 40px);}.stock-panel{overflow-x:auto}}

/* Stage 4C: warehouse transfers and count workflow */
#warehouseTransfersPanel p,#physicalCountsPanel p{font-size:13px;color:var(--muted);line-height:1.5}
#stocktakeProgress{border:1px solid #d7e4fa;background:#f3f8ff;border-radius:6px;padding:10px 12px}
#physicalCountsPanel h4{margin-top:20px}
#physicalCountsPanel .small-grid,#warehouseTransfersPanel .small-grid{height:265px}
#stocktakePostBtn:disabled,#stocktakeEditBtn:disabled{opacity:.55;cursor:not-allowed}

/* Stage 5 technician / mobile jobs – safe responsive layout without replacing Kendo or AG Grid */
.tech-filter{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.tech-filter select{min-width:200px;max-width:400px;padding:8px;border:1px solid var(--line);border-radius:5px}
.tech-filter button,.tech-actions button{padding:8px 13px;border:1px solid #bdcce5;border-radius:5px;background:#f8fbff;color:#1748a7;cursor:pointer}
.tech-filter button:disabled,.tech-actions button:disabled{opacity:.5;cursor:not-allowed}
.tech-error{color:#b42318;font-weight:600}.tech-ok{color:#285777}
.tech-job-grid{height:370px}.tech-detail-panel{min-width:0;scroll-margin-top:12px}
.tech-summary{padding:5px 0 15px}.tech-summary p{font-size:13px;color:var(--muted)}
.tech-status{display:inline-block;border:1px solid #bad0f3;background:#eef5ff;border-radius:6px;padding:8px 11px;margin:12px 0;font-weight:600}
.tech-task-list,.tech-time-list,.tech-note-list{min-height:100px;padding:10px 0}
.tech-check-row{display:flex;align-items:center;gap:10px;padding:12px 4px;border-bottom:1px solid var(--line);cursor:pointer}
.tech-check-row input{height:19px;width:19px}.tech-log-item{padding:11px 7px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.tech-mobile-cards{display:none;gap:10px;flex-direction:column}
.tech-job-card{text-align:left;width:100%;display:flex;flex-direction:column;gap:7px;border:1px solid #ceddf0;
  background:white;border-radius:9px;padding:13px 14px;color:var(--ink);cursor:pointer}
.tech-job-card strong{color:#1748a7}.tech-job-card span,.tech-job-card small{font-size:13px}
@media(max-width:760px){.tech-job-grid{display:none}.tech-mobile-cards{display:flex}
 .tech-filter>*{flex:1 1 100%}.tech-filter select{width:100%;max-width:none}
 .tech-actions button{flex:1 1 46%;min-height:44px}.tech-detail-panel{padding:12px}
 .tech-check-row{min-height:48px}.tech-summary h3{line-height:1.4}}

/* Stage 5 mobile polish – phone-only changes; desktop remains unchanged. */
.app-nav-scrim[hidden] { display:none!important; }
.nav-close { display:none; }
@media (max-width:760px) {
  html,body { max-width:100%; overflow-x:clip; }
  .app-shell,.app-shell.collapsed { display:block; width:100%; min-width:0; }
  .app-shell .app-nav, .app-shell.collapsed .app-nav,
  .app-shell:not(.collapsed) .app-nav {
    position:fixed; top:0; bottom:0; left:0;
    z-index:102; width:min(300px,86vw)!important;
    min-width:0; height:100dvh; max-height:100dvh;
    flex:0 0 auto!important; overflow:hidden;
    transform:translateX(-105%); transition:transform .18s ease;
    box-shadow:none;
  }
  .app-shell.mobile-nav-open .app-nav,
  .app-shell.collapsed.mobile-nav-open .app-nav { transform:translateX(0); box-shadow:4px 0 28px #071a4590; }
  .app-shell .app-nav .nav-label, .app-shell .app-nav .brand-title,
  .app-shell.collapsed .app-nav .nav-label, .app-shell.collapsed .app-nav .brand-title {
    display:block!important;
  }
  .app-shell .app-nav-item, .app-shell.collapsed .app-nav-item {
    justify-content:flex-start; padding:11px 17px;
  }
  .app-shell .app-brand, .app-shell.collapsed .app-brand {
    justify-content:flex-start; padding:14px 12px; min-height:66px; height:auto;
  }
  .nav-close { display:block; margin-left:auto; padding:4px 8px; border:0;
    border-radius:5px; background:#ffffff22; color:white; font-size:25px; cursor:pointer; }
  .app-nav-links { max-height:calc(100dvh - 66px); }
  .app-nav-scrim:not([hidden]) { display:block; position:fixed; inset:0; z-index:101;
    border:0; padding:0; background:#071830a8; cursor:pointer; }
  body.field-mobile-nav-open { overflow:hidden; }
  .app-main,.app-shell.collapsed .app-main { width:100%; min-width:0; margin:0; }
  .app-top { display:grid; grid-template-columns:36px minmax(0,1fr) auto;
    grid-template-areas:'toggle title logout' 'company company company';
    gap:5px 9px; height:auto; min-height:66px; padding:8px 12px;
    width:100%; position:relative; }
  .app-top .icon-button { grid-area:toggle; padding:4px; width:36px; min-height:36px; }
  .app-top .page-title { grid-area:title; margin:0; font-size:16px; line-height:1.3;
    min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:normal;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .app-top .top-grow,.app-top .user-label { display:none; }
  .app-top .company-switch { grid-area:company; width:100%; min-width:0; margin:1px 0 0; }
  .app-top .company-switch select,
  .app-top .company-switch .k-dropdownlist,
  .app-top .company-switch .k-dropdown,
  .app-top .company-switch .k-picker,
  .app-top .company-switch .k-widget { width:100%!important; min-width:0!important;
    max-width:100%!important; box-sizing:border-box; }
  .app-top > form:last-child { grid-area:logout; justify-self:end; min-width:0; }
  .app-top .logout-btn { padding:6px 8px; font-size:12px; min-height:36px; white-space:nowrap; }
  .app-content { padding:10px; width:100%; min-width:0; }
  .app-content .panel { padding:12px; width:100%; max-width:100%; }
  .page-intro { gap:6px; margin:0 0 12px; }
  .page-intro h2 { font-size:19px; }
  .page-intro p { line-height:1.45; }
  .tech-filter { gap:9px; }
  .tech-filter>* { flex:1 1 100%; min-width:0; }
  .tech-filter select { width:100%; max-width:none; }
  .tech-filter .k-dropdownlist,.tech-filter .k-picker,.tech-filter .k-widget {
    width:100%!important; max-width:100%!important; min-width:0!important; }
  .tech-filter button { min-height:43px; }
  .tech-job-grid { display:none; }
  .tech-mobile-cards { display:flex; width:100%; max-width:100%; }
  .tech-job-card { width:100%; min-width:0; padding:14px; gap:7px; font-size:14px;
    white-space:normal; overflow-wrap:anywhere; }
  .tech-job-card strong { font-size:14px; }
  .tech-job-card[aria-pressed='true'] { border:2px solid #1c55d0; background:#eef5ff; }
  .tech-detail-panel { scroll-margin-top:10px; }
  .tech-actions button { flex:1 1 100%; min-width:0; }
  #techTabs { min-width:0; width:100%; }
  #techTabs .k-tabstrip-items-wrapper { overflow-x:auto; max-width:100%; }
  #techTabs .k-tabstrip-items { flex-wrap:nowrap; }
  #techTabs .k-content,#techTabs .k-tabstrip-content { min-width:0; overflow-wrap:anywhere; }
  #techNoteWindow { max-width:100%; }
}

/* Stage 6 – evidence collection on desktop and phone. Existing shell/Kendo CDN untouched. */
.job-evidence{margin-top:22px;border-top:1px solid #d8e4f4;padding-top:15px;min-width:0}
.job-evidence-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.job-evidence-title h3{margin:4px 0 10px}
#evidenceTabs{min-width:0}
#evidenceTabs .k-content,#evidenceTabs .k-tabstrip-content{min-width:0;overflow-wrap:anywhere}
#evidenceTabs label,.evidence-form-fields label{display:block;margin:12px 0 6px;font-weight:600}
#evidenceTabs input:not([type=checkbox]):not([type=file]),#evidenceTabs select,.evidence-form-fields input,
.evidence-form-fields textarea,.evidence-form-fields select{display:block;width:100%;max-width:100%;box-sizing:border-box;padding:8px;
 border:1px solid #c3d1e4;border-radius:5px;margin-top:5px}
#evidenceTabs input[type=file]{width:100%;max-width:100%;font-size:13px;box-sizing:border-box;padding:10px 0}
.evidence-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.evidence-actions button,.job-evidence-title button{padding:9px 12px;border-radius:6px;background:#f7faff;border:1px solid #a9c2e9;color:#154aa8;cursor:pointer}
.evidence-actions button:disabled{opacity:.55;cursor:not-allowed}
.evidence-list{display:grid;gap:8px;padding:8px 0 12px}
.evidence-list .evidence-record{padding:11px 12px;border:1px solid #d6e3f6;background:#fbfdff;border-radius:7px;overflow-wrap:anywhere}
.evidence-record strong,.evidence-record small{display:block}.evidence-record small{color:#577094;margin-top:4px}
.evidence-record a{overflow-wrap:anywhere;color:#174db7}
.evidence-thumb{display:block;max-width:100%;max-height:180px;object-fit:contain;border-radius:6px;margin:6px 0}
#evidenceCanvas{box-sizing:border-box;display:block;width:100%;max-width:700px;touch-action:none;background:white;
 border:2px dashed #8aaadc;border-radius:8px;cursor:crosshair;height:190px;margin-top:8px}
#evidenceTabs .evidence-check{display:flex;gap:10px;align-items:flex-start;line-height:1.5;font-weight:normal}
.evidence-check input{flex:0 0 18px;width:18px;height:18px;margin:2px 0}
#evidenceMessage.evidence-error{color:#b42318;font-weight:600}
#evidenceMessage.evidence-ok{color:#135d49;font-weight:600}
.evidence-form-fields{display:grid;gap:5px;max-width:100%;min-width:0;padding:5px}
.evidence-form-fields input[type=checkbox]{display:inline-block;width:auto;margin-right:7px}
.evidence-form-fields .evidence-form-boolean{display:flex;gap:8px;align-items:center}
@media(max-width:760px){.job-evidence{margin-top:16px}.evidence-actions button{flex:1 1 100%;min-height:44px}
 #evidenceTabs .k-tabstrip-items-wrapper{max-width:100%;overflow-x:auto}
 #evidenceTabs .k-tabstrip-items{flex-wrap:nowrap}
 #evidenceTabs .k-content,#evidenceTabs .k-tabstrip-content{padding:10px}
 #evidenceFormWindow,#evidenceTemplateWindow{max-width:100%}}
.field-job-pdf{background:white;color:#18233a;padding:22px;font-family:Arial,sans-serif;font-size:13px;
  max-width:750px;box-sizing:border-box;line-height:1.45}
.field-job-pdf h2{border-bottom:2px solid #19449a;color:#173e86;padding-bottom:8px;margin:14px 0}
.field-job-pdf h3{color:#17429c;margin:18px 0 6px}
.field-job-pdf p{margin:7px 0;overflow-wrap:anywhere}
.field-job-pdf-sign{display:block;width:220px;height:90px;object-fit:contain;margin:12px 0}
#evidenceCardWindow{max-height:80vh;overflow:auto}
.evidence-pdf-table{width:100%;border-collapse:collapse;font-size:12px;margin-top:15px}
.evidence-pdf-table th,.evidence-pdf-table td{border:1px solid #d4e0ed;padding:7px;text-align:left;vertical-align:top}
.evidence-pdf-table th{background:#e6efff;color:#193b78}
.document-pdf-preview{min-width:0;max-width:100%;overflow:auto}

/* Stage 7: scheduler planning and safe reminder queue; no global Kendo overrides. */
.stage7-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:14px}
.stage7-toolbar label,.stage7-reminder-form label{font-size:13px;font-weight:650;color:#18375f}
.stage7-toolbar input[type=date],.stage7-reminder-form select{border:1px solid #ccd8e8;border-radius:5px;padding:8px;max-width:100%;background:#fff}
.stage7-btn{border:1px solid #bdcde6;background:#f8fbff;color:#1748a7;border-radius:5px;padding:9px 13px;cursor:pointer}
.stage7-btn:hover{background:#eaf2ff}
.stage7-help{font-size:13px;color:#60718c;line-height:1.55;margin:6px 0 14px}
.stage7-results{margin:10px 0;padding:12px;border:1px solid #e0e8f5;border-radius:6px;background:#fbfdff;font-size:13px}
.stage7-results p{margin:7px 0}
.stage7-reminder-form{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px 14px;align-items:center;margin:14px 0}
.stage7-reminder-form button{grid-column:2;justify-self:start}
.stage7-log-grid{height:320px;min-height:120px;width:100%}
#stage7Feedback{font-size:13px;font-weight:600;min-height:18px}
@media(max-width:760px){.stage7-reminder-form{grid-template-columns:1fr}.stage7-reminder-form button{grid-column:1;width:100%}.stage7-toolbar>*{flex:1 1 auto}.stage7-toolbar input[type=date]{min-width:0}.stage7-log-grid{height:260px}}

/* Stage 7: single two-calendar From/To chooser, independent of Scheduler's one-day navigator. */
.stage7-period-panel{border:1px solid #d8e3f3;border-radius:7px;padding:14px 16px;margin:12px 0 16px;background:#f9fbff}
.stage7-period-label{display:block;font-size:13px;font-weight:700;color:#19385c;margin:0 0 8px}
.stage7-period-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
#stage7PeriodPicker{flex:1 1 340px;min-width:0;max-width:540px}
#stage7PeriodPicker .k-daterangepicker{width:100%}
.stage7-period-panel .stage7-help{margin:8px 0 0}
@media(max-width:600px){.stage7-period-row{display:block}#stage7PeriodPicker{width:100%;max-width:100%}.stage7-period-row .stage7-btn{margin-top:10px;width:100%}}

/* Stage 8: compact workflow popup, no extra permanent panels. */
.journey-heading { font-weight:600; margin:10px 0 12px; }
.journey-actions {display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:44px;margin-bottom:8px}
.journey-action {padding:7px 12px;border-radius:5px;background:#174cc8;color:white;border:1px solid #174cc8;cursor:pointer}
.journey-action:disabled {opacity:.55;cursor:default}
.journey-muted {color:#526078;font-size:13px}
.journey-existing {margin-left:6px;font-size:13px}
.journey-grid {height:410px;min-height:240px;width:100%}
.journey-footnote {font-size:12px;color:#526078;margin-top:8px}
@media(max-width:760px) {.journey-grid {height:360px}.journey-actions {gap:5px}}

/* Stage 9 reports: compact operational summaries; no changes to other screens. */
.field-report { margin-bottom:16px;min-width:0; }
.report-controls { display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px 14px;margin:4px 0 15px; }
.report-controls label {display:flex;flex-direction:column;gap:5px;color:#253e65;font-size:13px;font-weight:600;}
.report-controls input {width:158px;}
.report-controls button {min-height:36px;}
.report-message {font-size:13px;color:#31547f;margin:10px 0;}
.report-error {color:#a52626;font-weight:600;}
.report-kpis {display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:11px;}
.report-kpi {display:flex;flex-direction:column;gap:6px;background:#f1f6ff;border:1px solid #d4e2f9;border-radius:7px;padding:14px 12px;}
.report-kpi strong {color:#1245a3;font-size:23px;font-variant-numeric:tabular-nums;}
.report-kpi span {color:#48617b;font-size:12px;}
.report-charts {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:14px;margin-bottom:16px;}
.report-charts .panel {min-width:0;}
.report-charts h3 {margin-top:2px;font-size:16px;}
.report-chart {height:305px;width:100%;min-width:0;}
.report-grid {height:440px;width:100%;min-width:0;}
.field-report #reportTabs {min-width:0;}
.field-report .k-tabstrip-content {min-width:0;overflow:hidden;padding:10px;}
.report-notes {font-size:12px;color:#526681;margin-top:16px;}
.report-notes ul {margin:6px 0;padding-left:20px;}
@media(max-width:760px){.report-chart{height:245px}.report-grid{height:350px}.report-kpi strong{font-size:19px}}

/* Stage 10: reusable administration workspace; no changes to scheduler/dashboard. */
.admin-workspace { min-width:0; }
.admin-workspace .k-tabstrip-content { min-width:0; }
.admin-workspace #adminTabs>.k-content { min-width:0; }
.admin-info { margin:0 0 12px; color:#174a9b; }
.admin-info.report-error { color:#b42318; }
.admin-toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:12px 0; }
.admin-toolbar #adminSearch { width:min(260px,100%); padding:8px; border:1px solid #c9d9ed; border-radius:4px; }
.admin-grow { flex:1; }
.admin-grid { width:100%; height:390px; min-width:0; }
.admin-help { font-size:13px; color:#536782; margin:12px 0; }
#adminPermissions { margin-top:18px; border-top:1px solid #d6e2f1; padding-top:12px; }
#adminPermissions p { font-size:13px; }
#adminEditorForm { padding:12px; display:grid; gap:10px; max-height:68vh; overflow:auto; }
.admin-editor-row { display:grid; grid-template-columns:140px minmax(0,1fr); gap:9px; align-items:center; }
.admin-editor-row>span { font-weight:600; font-size:13px; }
.admin-editor-row>input:not([type=checkbox]),.admin-editor-row>select,.admin-editor-row>textarea { width:100%; min-width:0; padding:8px; border:1px solid #b9cadf; border-radius:4px; }
.admin-editor-row>input[type=checkbox] { width:18px; height:18px; }
.admin-editor-row .k-input { width:100%; }
.admin-editor-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
@media(max-width:700px){.admin-editor-row{grid-template-columns:1fr;gap:4px}.admin-grid{height:340px}.admin-toolbar{gap:6px}}

/* Responsive Kendo Windows – phone-sized Add/Edit, document, and status popups.
   Window pixel width is updated in field-ui.js on open and viewport changes. */
.field-responsive-window { box-sizing:border-box; max-width:calc(100vw - 16px) !important; }
.field-responsive-window .k-window-content { box-sizing:border-box; min-width:0; max-width:100%; }
.field-responsive-window .form-row > * { min-width:0; }
@media (max-width:760px) {
  .field-responsive-window { max-height:calc(100dvh - 12px) !important; }
  .field-responsive-window .k-window-content {
    max-height:calc(100dvh - 68px) !important;
    min-width:0 !important; overflow-y:auto !important; overflow-x:hidden !important;
    padding:12px !important;
  }
  .field-responsive-window .form-row,
  .field-responsive-window .document-popup .form-row {
    display:grid; grid-template-columns:minmax(0, 1fr) !important;
    gap:5px; margin:10px 0; align-items:start;
  }
  .field-responsive-window .form-row label { display:block; width:100%; }
  .field-responsive-window .form-row input:not([type=checkbox]),
  .field-responsive-window .form-row select,
  .field-responsive-window .form-row textarea,
  .field-responsive-window .form-row .k-picker,
  .field-responsive-window .form-row .k-dropdownlist,
  .field-responsive-window .form-row .k-numerictextbox,
  .field-responsive-window .form-row .k-widget {
    box-sizing:border-box; width:100% !important; max-width:100% !important;
    min-width:0 !important;
  }
  .field-responsive-window .window-actions { flex-wrap:wrap; gap:8px; }
  .field-responsive-window .window-actions button { min-height:40px; }
}
