@import url("./design-system-polish.css");

/* Phase 10 retained active overrides externalized from index.html. */

.programme-sheet th:first-child,.programme-sheet td:first-child{width:38px!important;min-width:38px!important;max-width:38px!important;text-align:center;padding-left:4px!important;padding-right:4px!important}.programme-sheet th:first-child input[type=checkbox],.programme-sheet td:first-child input[type=checkbox]{width:16px!important;height:16px!important;min-width:16px!important;padding:0!important;margin:0 auto!important}@media print{body:not(.printing) .sidebar,body:not(.printing) .topbar,body:not(.printing) button{display:none!important}body:not(.printing) .app{display:block!important}body:not(.printing) .main{padding:0!important}}

.p7-list{display:flex;flex-direction:column}.p7-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}.p7-item:last-child{border-bottom:0}.p7-item .muted{margin-top:3px;font-size:11px}@media(max-width:720px){.p7-item{align-items:flex-start;flex-direction:column}.p7-item .btn{width:100%}}


/* Compact desktop/tablet portal shell. The R10.17 phone shell is untouched. */
@media screen {
 html.p8-full-portal-mode .sidebar .brand {
  padding-bottom:14px;
 }
 html.p8-full-portal-mode .sidebar .brand small {
  display:block;
  line-height:1.4;
 }
 html.p8-full-portal-mode .sidebar > .portal-search-shell {
  width:100%;
  min-width:0;
  margin:14px 0 17px;
  z-index:80;
 }
 html.p8-full-portal-mode .sidebar .portal-search-box {
  padding:8px 10px;
  background:#0d3553;
  border:1px solid #35526b;
  border-radius:9px;
  box-shadow:none;
 }
 html.p8-full-portal-mode .sidebar .portal-search-box:focus-within {
  background:#123d5e;
  border-color:#d78a48;
  box-shadow:0 0 0 2px rgba(239,123,25,.16);
 }
 html.p8-full-portal-mode .sidebar .portal-search-box .ui-icon {
  color:#afc3d4;
 }
 html.p8-full-portal-mode .sidebar .portal-search-box input {
  min-height:25px;
  color:#f3f7fb!important;
  font-size:12px;
 }
 html.p8-full-portal-mode .sidebar .portal-search-box input::placeholder {
  color:#aec2d1;
  opacity:1;
 }
 html.p8-full-portal-mode .sidebar .portal-search-box kbd {
  display:none;
 }
 html.p8-full-portal-mode .sidebar .portal-search-panel {
  left:0;
  right:auto;
  width:100%;
  max-height:min(60vh,470px);
 }
 html.p8-full-portal-mode .sidebar .portal-search-result {
  grid-template-columns:minmax(0,1fr);
 }
 html.p8-full-portal-mode .sidebar .portal-search-result small {
  grid-column:1;
 }
 html.p8-full-portal-mode .sidebar .portal-search-type {
  justify-self:start;
 }
 html.p8-full-portal-mode .topbar {
  min-height:70px;
  padding:12px 16px;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
 }
 html.p8-full-portal-mode .topbar .title {
  flex:1 1 240px;
  min-width:0;
 }
 html.p8-full-portal-mode .topbar .title h2 {
  font-size:24px;
  line-height:1.2;
 }
 html.p8-full-portal-mode .topbar #pageSub {
  display:none!important;
 }
 html.p8-full-portal-mode .topbar .portal-breadcrumbs {
  display:flex;
  margin-top:4px;
  padding:0;
  max-width:100%;
  min-height:19px;
 }
 html.p8-full-portal-mode .topbar .portal-crumb {
  font-size:11px;
  padding:1px 4px;
 }
 html.p8-full-portal-mode .topbar .right-top {
  margin-left:auto;
  gap:8px;
  align-items:center;
 }
 html.p8-full-portal-mode .topbar .cloud-head {
  flex-wrap:nowrap;
  gap:8px;
 }
 html.p8-full-portal-mode .topbar .cloud-user {
  display:inline-block!important;
  max-width:185px;
  font-size:12px;
  font-weight:650;
  color:#254560;
  text-overflow:ellipsis;
  overflow:hidden;
  white-space:nowrap;
 }
 html.p8-full-portal-mode .topbar #roleSelect {
  display:none!important;
 }
 html.p8-full-portal-mode .topbar .kk-compact-icon-btn {
  width:34px;
  height:34px;
  min-width:34px;
  min-height:34px;
  padding:7px;
  border-radius:9px;
  line-height:1;
  vertical-align:middle;
 }
 html.p8-full-portal-mode .topbar .kk-compact-icon-btn svg {
  display:block;
  width:18px;
  height:18px;
  margin:auto;
 }
 html.p8-full-portal-mode .topbar #pageActions {
  gap:6px;
 }
 html.p8-full-portal-mode .topbar #pageActions .btn {
  padding:7px 10px;
 }
 html.p8-full-portal-mode .topbar #pageActions .p9-history-action,
 html.p8-full-portal-mode .topbar #pageActions button[onclick*="appwriteRefresh("] {
  display:none!important;
 }
 html.p8-full-portal-mode .portal-utility-bar,
 html.p8-full-portal-mode #pageSaveState,
 html.p8-full-portal-mode .database-banner {
  display:none!important;
 }
 /* Remove only the five MD overview summary cards, not the operational tables
    or the resources reports farther down the same dashboard. */
 html.p8-full-portal-mode body.kk-compact-md-overview #content > .grid.cards {
  display:none!important;
 }
 @media(max-width:1100px) {
  html.p8-full-portal-mode .topbar {
   flex-wrap:wrap;
   align-items:flex-start;
  }
  html.p8-full-portal-mode .topbar .right-top {
   flex:0 1 auto;
  }
 }
 @media(max-width:850px) {
  html.p8-full-portal-mode .topbar .title {
   flex-basis:100%;
  }
  html.p8-full-portal-mode .topbar .right-top {
   margin-left:0;
  }
  html.p8-full-portal-mode .topbar .cloud-user {
   max-width:160px;
  }
 }
}

/* Keep the selected planning subtab readable on the navy active background. */
@media screen {
 html.p8-full-portal-mode .programme-subtabs button.active,
 html.p8-full-portal-mode .programme-subtabs button.active .ui-icon {
  color:#fff!important;
 }
 html.p8-full-portal-mode .programme-subtabs button.active svg {
  stroke:currentColor;
 }
}

/* Importation records scroll horizontally as one table, without a frozen first column. */
@media screen {
 html.p8-full-portal-mode .importation-sheet {
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-x:contain;
 }
 html.p8-full-portal-mode .importation-sheet table.importation-table {
  width:2166px;
  min-width:2166px;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
 }
 html.p8-full-portal-mode .importation-sheet.unified-sheet thead th:first-child {
  position:sticky!important;
  top:0;
  left:auto!important;
  z-index:3!important;
  box-shadow:none!important;
 }
 html.p8-full-portal-mode .importation-sheet.unified-sheet tbody td:first-child,
 html.p8-full-portal-mode .importation-sheet.unified-sheet tfoot th:first-child,
 html.p8-full-portal-mode .importation-sheet.unified-sheet tfoot td:first-child {
  position:static!important;
  left:auto!important;
  z-index:auto!important;
  box-shadow:none!important;
 }
 html.p8-full-portal-mode .importation-sheet :is(th,td) {
  box-sizing:border-box;
  padding:8px 7px;
  vertical-align:middle;
 }
 html.p8-full-portal-mode .importation-sheet input,
 html.p8-full-portal-mode .importation-sheet select {
  width:100%;
  min-width:0!important;
  max-width:100%;
  box-sizing:border-box;
 }
 html.p8-full-portal-mode .importation-sheet .importation-actions {
  white-space:normal;
 }
 html.p8-full-portal-mode .importation-sheet .importation-actions .btn {
  padding:6px 8px;
  margin:2px;
 }
 html.p8-full-portal-mode .importation-sheet .importation-invoice-actions {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:7px;
  min-width:0;
 }
 html.p8-full-portal-mode .importation-sheet .file-chip {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  overflow-wrap:anywhere;
  white-space:normal;
  max-width:100%;
 }
 html.p8-full-portal-mode .importation-sheet .importation-invoice-input {
  width:100%;
  max-width:100%;
  padding:4px 0;
  color:#354e63;
  font-size:10px;
 }
 html.p8-full-portal-mode .importation-sheet .importation-invoice-input::file-selector-button {
  border:1px solid #cedce8;
  border-radius:7px;
  background:#f5f9fc;
  color:#103b5c;
  padding:6px 8px;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
  margin-right:5px;
 }
 html.p8-full-portal-mode .importation-sheet .importation-no-file {
  color:#8293a4;
  font-size:11px;
 }
 html.p8-full-portal-mode .importation-sheet .importation-uploading {
  opacity:.65;
  pointer-events:none;
 }
 html.p8-full-portal-mode .importation-sheet tfoot th {
  background:#edf3f8!important;
  font-weight:800;
  text-align:right;
 }
 html.p8-full-portal-mode .importation-sheet .importation-totals {
  white-space:normal;
  font-variant-numeric:tabular-nums;
 }
}
@media print {
 .importation-invoice-input {display:none!important}
}

/* Site Operations consolidation: all full-portal devices including tablets. */
@media screen {
 html.p8-full-portal-mode .portal-print-icon-button {
  display:inline-flex!important;align-items:center;justify-content:center;
  width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;
  padding:7px!important;border-radius:9px!important;line-height:1;
 }
 html.p8-full-portal-mode .portal-print-icon-button svg {display:block;width:18px;height:18px;flex:0 0 18px}
 html.p8-full-portal-mode .date-with-day {
  display:inline-flex;align-items:center;gap:10px;vertical-align:middle;white-space:nowrap;
 }
 html.p8-full-portal-mode .date-with-day .sheet-select {min-width:160px!important}
 html.p8-full-portal-mode .date-with-day small {
  display:inline-block;margin:0;align-self:center;line-height:1.2;font-size:10px;color:#647990;
 }
 html.p8-full-portal-mode .kk-petty-cash-sheet {margin-top:12px;min-width:0}
 html.p8-full-portal-mode .kk-petty-cash-sheet .section-title {margin:10px 0 12px}
 html.p8-full-portal-mode .report-chart-grid.kk-weekly-report-charts {
  grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;
 }
 html.p8-full-portal-mode .kk-manpower-chart-layout {
  display:flex;align-items:center;gap:14px;justify-content:flex-start;min-width:0;
 }
 html.p8-full-portal-mode .kk-manpower-chart-layout svg {
  flex:0 1 192px;width:192px;max-width:46%;height:auto;max-height:210px;
 }
 html.p8-full-portal-mode .kk-manpower-legend {flex:1;min-width:0;display:grid;gap:7px}
 html.p8-full-portal-mode .kk-manpower-legend-title {font-size:11px;font-weight:750;color:#344e65;margin-bottom:2px}
 html.p8-full-portal-mode .kk-manpower-legend-item {
  display:grid;grid-template-columns:11px minmax(0,1fr) auto auto;
  gap:6px;align-items:center;font-size:11px;
 }
 html.p8-full-portal-mode .kk-manpower-legend-item span:nth-child(2) {min-width:0;overflow-wrap:anywhere}
 html.p8-full-portal-mode .kk-manpower-legend-item b {font-size:11px;color:#163c5b}
 html.p8-full-portal-mode .kk-manpower-legend-item small {font-size:10px;color:#687d8e}
 html.p8-full-portal-mode .kk-manpower-swatch {height:11px;width:11px;border-radius:3px}
 html.p8-full-portal-mode .kk-report-control-stats {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
 }
 html.p8-full-portal-mode .kk-report-control-stats .card {padding:11px 12px;border-radius:9px;box-shadow:none}
 html.p8-full-portal-mode .kk-report-control-stats .kpi-label {font-size:10px;margin-bottom:6px}
 html.p8-full-portal-mode .kk-report-control-stats .kpi-value {font-size:19px;overflow-wrap:anywhere}
 html.p8-full-portal-mode .kk-report-control-stats .kpi-sub:empty {display:none}
 html.p8-full-portal-mode .kk-weekly-outcomes > div {min-width:0}
 html.p8-full-portal-mode .kk-weekly-outcomes table {
  width:100%;min-width:0!important;table-layout:auto;
 }
 html.p8-full-portal-mode .kk-weekly-outcomes th:first-child,
 html.p8-full-portal-mode .kk-weekly-outcomes td:first-child {width:62%;min-width:0;white-space:normal}
 html.p8-full-portal-mode .kk-weekly-outcomes td:first-child b {font-weight:750;color:#133a58}
 html.p8-full-portal-mode .kk-weekly-outcomes td:nth-child(2),
 html.p8-full-portal-mode .kk-weekly-outcomes td:nth-child(3) {font-weight:400;white-space:nowrap}
}
@media screen and (max-width:1120px){
 html.p8-full-portal-mode .report-chart-grid.kk-weekly-report-charts {grid-template-columns:minmax(0,1fr)}
}
@media screen and (max-width:600px){
 html.p8-full-portal-mode .kk-manpower-chart-layout {flex-wrap:wrap}
 html.p8-full-portal-mode .kk-manpower-chart-layout svg {flex-basis:170px;max-width:170px}
 html.p8-full-portal-mode .date-with-day {flex-wrap:wrap;gap:5px}
}
@media print {
 .kk-weekly-report-charts .kk-manpower-chart-layout{display:flex;align-items:center;gap:10px}
 .kk-weekly-report-charts .kk-manpower-chart-layout svg{width:150px;height:150px}
 .kk-weekly-report-charts .kk-manpower-legend{flex:1}
 .kk-weekly-outcomes table {width:100%;min-width:0}
}

/* Materials: readable fixed PO categories, pricing and print-only active section. */
@media screen {
 html.p8-full-portal-mode .request-sheet .kk-po-locked {
  display:block;padding:8px 7px;color:#24435e;font-size:12px;line-height:1.35;
  white-space:normal;overflow-wrap:anywhere;
 }
 html.p8-full-portal-mode .request-sheet .sheet th:nth-child(3) {
  min-width:170px;
 }
 html.p8-full-portal-mode .request-sheet .sheet tbody td[data-po-line-amount],
 html.p8-full-portal-mode .request-sheet .sheet tfoot th[data-po-total] {
  text-align:right;font-variant-numeric:tabular-nums;font-weight:700;
 }
 html.p8-full-portal-mode .roadmap-movement-list .section-title {align-items:center}
 html.p8-full-portal-mode .portal-header-print {flex:0 0 auto}
}
@media print {
 .request-sheet .kk-po-locked {white-space:normal}
 .roadmap-movement-list,.request-sheet {break-inside:auto}
}

/* Indented Materials submodule and rightmost Sign Out control. */
@media screen {

 html.p8-full-portal-mode .topbar .right-top > #cloudLogoutBtn {
  flex:0 0 auto;
  order:10;
 }
 html.p8-full-portal-mode .topbar .right-top > #pageActions {
  order:9;
 }
}

/* Full-portal management chrome. Phone R11.4 controls are unchanged. */
@media screen {
 html.p8-full-portal-mode .topbar #cloudRefreshBtn {
  display:none!important;
 }
 html.p8-full-portal-mode .topbar #cloudPill {
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 16px!important;
  padding:0!important;
  border:0!important;
  margin:0 1px 0 0!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:50%!important;
 }
 html.p8-full-portal-mode .topbar #cloudPill #cloudStatus {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
 }
 html.p8-full-portal-mode .topbar #cloudPill .cloud-dot {
  display:block;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#188b64;
  animation:kkDesktopCloudPulse 2.4s ease-in-out infinite;
 }
 html.p8-full-portal-mode .topbar #cloudPill.syncing .cloud-dot {
  width:12px;
  height:12px;
  background:transparent;
  border:2px solid rgba(220,125,28,.25);
  border-top-color:#e67b1d;
  animation:kkDesktopCloudSpin .85s linear infinite;
 }
 html.p8-full-portal-mode .topbar #cloudPill.error .cloud-dot {
  background:#c44840;
  animation:kkDesktopCloudPulse 1.4s ease-in-out infinite;
 }
}
@keyframes kkDesktopCloudPulse {
 0%,100%{opacity:.66;transform:scale(.88)}
 50%{opacity:1;transform:scale(1.08)}
}
@keyframes kkDesktopCloudSpin {
 to{transform:rotate(360deg)}
}
@media screen and (prefers-reduced-motion:reduce) {
 html.p8-full-portal-mode .topbar #cloudPill .cloud-dot {
  animation:none!important;
 }
}


/* R12.1: Compact single-row header for desktop and full-portal tablet/foldable
   screens. Do not affect phone mode or alter the R12 synchronization indicator. */
@media screen {
 html.p8-full-portal-mode .topbar {
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:space-between!important;
  min-height:0!important;
  gap:12px!important;
  padding:9px 14px!important;
  margin-bottom:12px!important;
 }
 html.p8-full-portal-mode .topbar .title {
  flex:1 1 180px!important;
  min-width:0!important;
  width:auto!important;
 }
 html.p8-full-portal-mode .topbar .title h2 {
  font-size:22px!important;
  line-height:1.16!important;
  margin:0!important;
 }
 html.p8-full-portal-mode .topbar .portal-breadcrumbs {
  margin-top:4px!important;
  min-height:16px!important;
 }
 html.p8-full-portal-mode .topbar .right-top {
  display:flex!important;
  flex-direction:row!important;
  flex:0 1 auto!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-end!important;
  align-self:center!important;
  width:auto!important;
  min-width:0!important;
  max-width:calc(100% - 135px)!important;
  margin:0 0 0 auto!important;
  gap:7px!important;
 }
 html.p8-full-portal-mode .topbar .cloud-head {
  display:flex!important;
  order:1!important;
  flex:0 1 auto!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  min-width:0!important;
  gap:6px!important;
 }
 html.p8-full-portal-mode .topbar .cloud-user {
  max-width:172px!important;
  flex:0 1 auto!important;
  min-width:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
 }
 html.p8-full-portal-mode .topbar #pageActions {
  display:flex!important;
  order:2!important;
  flex:0 1 auto!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  overflow-x:auto;
  overflow-y:hidden;
  min-width:0!important;
  max-width:100%;
  scrollbar-width:none;
 }
 html.p8-full-portal-mode .topbar #pageActions::-webkit-scrollbar {
  display:none;
 }
 html.p8-full-portal-mode .topbar #pageActions .btn {
  flex:0 0 auto;
  min-height:34px!important;
  white-space:nowrap;
 }
 html.p8-full-portal-mode .topbar .right-top > #cloudLogoutBtn {
  order:3!important;
  flex:0 0 34px!important;
  margin-left:0!important;
 }
}
@media screen and (max-width:900px) {
 html.p8-full-portal-mode .topbar {
  padding:9px 11px!important;
  gap:8px!important;
 }
 html.p8-full-portal-mode .topbar .title h2 {
  font-size:20px!important;
 }
 html.p8-full-portal-mode .topbar .right-top {
  max-width:calc(100% - 108px)!important;
  gap:5px!important;
 }
 html.p8-full-portal-mode .topbar .cloud-user {
  max-width:118px!important;
 }
}
