:root {
  --tps-ink: #10213e;
  --tps-muted: #60758e;
  --tps-line: #dce5f0;
  --tps-surface: #fff;
  --tps-soft: #f4f7fb;
  --tps-blue: #2563eb;
}

.tps-planning-module-title {
  min-width: 0;
  max-width: min(600px, 52vw) !important;
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
}

.tps-planning-module-title strong,
.tps-planning-module-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit !important;
}

.tps-planning-module-title strong {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 18px !important;
}

.tps-app-shell > section.settings-hub > header:first-child,
.tps-app-shell .settings-hub > header:first-child {
  display: none !important;
}

.tps-planning-module-title small {
  font-size: 12px !important;
  line-height: 14px !important;
  white-space: nowrap;
}

.tps-app-shell,
.tps-app-shell *,
body.tps-embedded,
body.tps-embedded *,
body.embedded,
body.embedded * {
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
}

/* Module names and their summaries live in the shared TPS top bar. Keep
   embedded-module tabs and operational controls in their existing toolbars. */
.tps-app-shell .tps-resource-page-header,
.tps-app-shell .settings-profile-header,
.tps-app-shell main > header:first-child > div:first-child:has(> h1),
body.tps-embedded main.page > header.head,
body.tps-embedded > header .brand,
body.tps-embedded header.top .brand,
body.embedded header .brand,
body.embedded header .back {
  display: none !important;
}

/* Shared navigation pattern based on the Warehouse module tabs. */
.tps-app-shell > div nav[aria-label="Moduły TPS"],
.tps-app-shell > div nav:has(> button),
.tps-app-shell > :not(aside) nav:has(> button),
.settings-hub nav:has(> button),
.settings-tab-content nav:has(> button),
.warehouse-page > nav,
main:not(.tps-app-shell) nav:has(> button),
body.tps-embedded nav:has(> button),
body.embedded nav:has(> button) {
  box-sizing: border-box;
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 8px;
  border: 1px solid var(--tps-line);
  border-radius: 8px;
  background: var(--tps-surface);
  box-shadow: 0 1px 3px rgb(16 33 62 / 5%);
}

.tps-app-shell > div nav[aria-label="Moduły TPS"] > button,
.tps-app-shell > div nav:has(> button) > button,
.tps-app-shell > :not(aside) nav:has(> button) > button,
.settings-hub nav:has(> button) > button,
.settings-tab-content nav:has(> button) > button,
.warehouse-page > nav > button,
main:not(.tps-app-shell) nav:has(> button) > button,
body.tps-embedded nav:has(> button) > button,
body.embedded nav:has(> button) > button {
  box-sizing: border-box;
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--tps-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.tps-app-shell > div nav[aria-label="Moduły TPS"] > button:hover,
.tps-app-shell > div nav:has(> button) > button:hover,
.tps-app-shell > :not(aside) nav:has(> button) > button:hover,
.settings-hub nav:has(> button) > button:hover,
.settings-tab-content nav:has(> button) > button:hover,
.warehouse-page > nav > button:hover,
main:not(.tps-app-shell) nav:has(> button) > button:hover,
body.tps-embedded nav:has(> button) > button:hover,
body.embedded nav:has(> button) > button:hover {
  border-color: #d6e4f7;
  background: #f1f6fd;
  color: #1758bd;
}

.tps-app-shell > div nav[aria-label="Moduły TPS"] > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
.tps-app-shell > div nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
.tps-app-shell > :not(aside) nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
.settings-hub nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
.settings-tab-content nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
.warehouse-page > nav > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
main:not(.tps-app-shell) nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
body.tps-embedded nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]),
body.embedded nav:has(> button) > :is(button[aria-current="page"], button[aria-selected="true"], button.active, button[class*="tab-active"], button[class*="bg-blue-600"], button[class*="border-blue-600"], button[class*="text-blue-700"]) {
  border-color: var(--tps-blue);
  background: var(--tps-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgb(37 99 235 / 20%);
}

.tps-app-shell {
  color: var(--tps-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.tps-app-shell > header {
  box-sizing: border-box;
  height: 40px !important;
  min-height: 40px !important;
  gap: 12px;
  padding-inline: 12px;
  border-color: var(--tps-line);
  box-shadow: 0 1px 3px rgb(16 33 62 / 5%);
}

.tps-app-shell > header > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--tps-ink);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tps-app-shell button:focus-visible,
.tps-app-shell input:focus-visible,
.tps-app-shell select:focus-visible,
body.tps-embedded button:focus-visible,
body.tps-embedded input:focus-visible,
body.tps-embedded select:focus-visible,
body.embedded button:focus-visible,
body.embedded input:focus-visible,
body.embedded select:focus-visible {
  outline: 2px solid #6aa3ff;
  outline-offset: 1px;
}

.tps-module-toolbar {
  box-sizing: border-box;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 5px 10px;
  border: 0;
  border-bottom: 1px solid var(--tps-line);
  border-radius: 0;
  background: var(--tps-surface);
  box-shadow: none;
}

.tps-module-toolbar :is(button, input, select) {
  box-sizing: border-box;
  min-height: 30px;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
}

.tps-module-toolbar button {
  padding: 5px 9px;
  border: 1px solid #ccdae9;
  background: #fff;
  color: #24415f;
  font-weight: 650;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.tps-module-toolbar button:hover {
  border-color: #9bbce9;
  background: #f1f6fd;
}

.tps-module-toolbar button.primary {
  border-color: var(--tps-blue);
  background: var(--tps-blue);
  color: #fff;
}

.tps-module-toolbar :is(input, select) {
  padding: 5px 8px;
  border: 1px solid #cbd8e7;
  background: #fff;
  color: var(--tps-ink);
}

body.tps-embedded,
body.embedded {
  min-width: 0;
  margin: 0;
  background: var(--tps-soft);
  color: var(--tps-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.tps-embedded > .top,
body.embedded > header {
  position: relative;
  z-index: 4;
  box-sizing: border-box;
  display: flex;
  min-height: 42px;
  height: auto;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 5px 10px;
  border: 0;
  border-bottom: 1px solid var(--tps-line);
  border-radius: 0;
  background: var(--tps-surface);
  box-shadow: none;
}

body.tps-embedded .brand,
body.tps-embedded .back,
body.embedded .brand,
body.embedded .back {
  display: none !important;
}

body.tps-embedded .wrap,
body.embedded .page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.tps-embedded .top > .tabs,
body.tps-embedded header > .tabs,
body.embedded header > .tabs {
  min-width: 0;
  flex: 0 1 auto;
  gap: 4px;
  margin: 0;
}

body.tps-embedded .top > .tabs button,
body.tps-embedded header > .tabs button,
body.embedded header > .tabs button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--tps-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

body.tps-embedded .top > .tabs button.active,
body.tps-embedded header > .tabs button.active,
body.embedded header > .tabs button.active {
  border-color: var(--tps-blue);
  background: var(--tps-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgb(37 99 235 / 20%);
}

body.tps-embedded .top > .toolbar,
body.embedded header > .bar,
body.tps-embedded .tps-module-toolbar > .tabs,
body.tps-embedded .tps-module-toolbar > .salary-topbar,
body.tps-embedded .tps-module-toolbar > .salary-subtabs {
  box-sizing: border-box;
  display: flex;
  min-width: 0;
  min-height: 30px;
  flex: 1 1 560px;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.tps-embedded #salaryCalculatorPage .salary-topbar,
body.tps-embedded #salaryCalculatorPage .salary-subtabs {
  display: none;
}

body.tps-embedded .tps-module-toolbar > .salary-subtabs button {
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

body.tps-embedded .tps-module-toolbar > .salary-subtabs button.active {
  background: #eaf2ff;
  color: #1758bd;
  box-shadow: inset 0 -2px var(--tps-blue);
}

body.tps-embedded .head {
  display: none !important;
}

@media (max-width: 1100px) {
  body.tps-embedded > .top,
  body.embedded > header {
    align-items: flex-start;
  }

  body.tps-embedded .top > .tabs,
  body.tps-embedded header > .tabs,
  body.embedded header > .tabs,
  body.tps-embedded .top > .toolbar,
  body.embedded header > .bar {
    flex-basis: 100%;
  }
}

/* Distinct but restrained styling, scoped only to the daily-plan week switcher. */
.tps-app-shell .tps-daily-week-nav {
  gap: 4px;
  padding: 1px;
  border: 1px solid #d9e5f4;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f5f8fd 100%);
  box-shadow: 0 2px 5px rgb(16 33 62 / 7%);
}

.tps-app-shell .tps-daily-week-nav > button {
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid #cfdded !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fff 0%, #f7faff 100%) !important;
  color: #244b78 !important;
  font-size: 9px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgb(16 33 62 / 8%);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.tps-app-shell .tps-daily-week-nav > button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #8db3e5 !important;
  background: linear-gradient(180deg, #fff 0%, #edf5ff 100%) !important;
  box-shadow: 0 3px 7px rgb(37 99 235 / 13%);
}

.tps-app-shell .tps-daily-week-nav > button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgb(16 33 62 / 10%);
}

.tps-app-shell .tps-daily-week-nav > b {
  min-width: 140px;
  padding: 2px 5px;
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  background: #edf4ff;
  color: #123d70;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 700px) {
  .tps-app-shell .tps-daily-week-nav {
    gap: 4px;
    padding: 2px;
  }

  .tps-app-shell .tps-daily-week-nav > button {
    min-height: 23px;
    padding-inline: 5px;
    font-size: 9px;
  }

  .tps-app-shell .tps-daily-week-nav > b {
    min-width: 124px;
    padding-inline: 3px;
    font-size: 9px;
  }
}

/* Loads and Planning load-card columns: 5px gaps, spare width for city/time. */
.loads-board .load-row-grid{grid-template-columns:minmax(90px,1.7fr) minmax(58px,1fr) 64px 48px 16px!important;column-gap:5px!important}

/* Keep the System settings sub-tabs visible while scrolling long update pages. */
.settings-hub-v2>div:last-child>nav{position:sticky!important;top:76px!important;z-index:40!important;background:#fff!important;box-shadow:0 2px 5px rgb(20 53 91 / 8%)!important}

/* Active compact load cards use inline grid styles; keep city/time flexible and enforce 5px gutters. */


/* Active compact load cards use inline grid styles; keep city/time flexible and enforce 5px gutters. */


/* Keep the System settings sub-tabs visible while scrolling long update pages. */
.settings-system-subnav{position:sticky!important;top:76px!important;z-index:40!important;background:#fff!important;box-shadow:0 2px 5px rgb(20 53 91 / 8%)!important}

/* Active compact load cards use inline grid styles; keep city/time flexible and enforce 5px gutters. */

/* Leave exactly 4px before the direction-code divider after REF/TMS. */


/* Active load cards: only the city absorbs spare width; all other fields remain fixed with 4px gutters. */





/* Load tiles: flexible city/hours area, compact fixed fields and exact 4px gutters. */





/* Load tiles: flexible city/hours area, compact fixed fields, 4px gutters and character caps. */








/* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */








/* Load tiles: preserve all existing grid dimensions and ellipsize text inside its assigned cell. */






  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  
  
  
  
  
  
  
  
  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  
  
  
  
  
  
  
  
  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  
  
  
  
  
  
  
  
  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  
  
  
  
  
  
  
  
  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  
  
  
  
  
  
  
  
  
  /* Load tiles: fixed assigned columns with width-based ellipsis and a centered 10px action rail. */
  .load-row-grid[style]{grid-template-columns:minmax(0,1fr) 45px 70px 70px 22px 14px!important;column-gap:4px!important}
  .load-row-grid[style]>:first-child{grid-template-columns:42px 4px minmax(0,1fr)!important}
  .load-row-grid[style]>:first-child>:nth-child(2){padding-left:0!important}
  .load-row-grid[style]>[title^="Kierunek"]{margin-left:0!important}
  .load-row-grid[style]>[class*="col-start-4"]{margin-left:2px!important}
  .load-row-grid[style]>:first-child [class*="col-start-3"]{max-width:none!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .load-row-grid[style]>[class*="col-start-"]{max-width:none!important;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  button[aria-label="Akcje ładunku"]{width:10px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important}
  
  /* Resources: reserve room for seven complete table rows in each list. */
  @media(min-width:901px){.tps-resources-page .resource-table-scroll{height:295px!important;max-height:295px!important;min-height:295px!important;overflow-y:auto!important;overflow-x:auto!important}}
  

/* Keep the System settings sub-tabs visible while scrolling long update pages. */
.settings-system-subnav{position:sticky!important;top:76px!important;z-index:40!important;background:#fff!important;box-shadow:0 2px 5px rgb(20 53 91 / 8%)!important}

/* Zasoby: dodatkowa wysokość na jeden wiersz kierowcy */
@media (min-width:901px){.tps-resources-page .resource-table-driver .resource-table-scroll{height:329px!important;max-height:329px!important;min-height:329px!important}.tps-resources-page .resource-table-driver .resource-table{min-width:1180px!important}}
