.module-view {
  max-width: 1700px;
  margin: 0 auto;
}
.module-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}
.module-tabs button {
  min-height: 42px;
  padding: 10px 18px;
}
.module-tabs [aria-current="page"] {
  background: #2b66c9;
  color: white;
  border-color: #2b66c9;
}
.module-toolbar,
.module-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.module-toolbar label,
.module-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  min-width: 150px;
}
.module-toolbar input,
.module-toolbar select,
.module-filters input,
.module-filters select {
  min-height: 42px;
}
.module-wide {
  grid-column: 1/-1;
  min-width: 0;
}
.module-card {
  background: white;
  border: 1px solid #dfe3eb;
  border-radius: 10px;
  margin: 18px 0;
  overflow: hidden;
}
.module-card .block-head {
  flex-wrap: wrap;
  gap: 10px;
}
.module-card .block-body {
  padding: 20px;
}
.module-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.module-metric {
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.module-metric > span {
  color: #596276;
  font-size: 13px;
}
.module-metric strong {
  font-size: 21px;
  line-height: 1.35;
}
.module-metric small {
  color: #677184;
  font-size: 12px;
  line-height: 1.5;
}
.financial-primary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.module-view .financial-details {
  background: #fff;
  border: 1px solid #dde2eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}
.financial-details > summary {
  padding: 18px 20px;
  color: #36435a;
}
.financial-details[open] > summary {
  border-bottom: 1px solid #e4e7ee;
}
.financial-details-body {
  padding: 4px 20px 20px;
}
.financial-data-notice {
  color: #786132;
  font-size: 13px;
}
.financial-data-notice button {
  padding: 4px 8px;
  font-size: inherit;
}
.module-table {
  width: 100%;
  border-collapse: collapse;
}
.module-table td,
.module-table th {
  padding: 12px;
  vertical-align: top;
  border-bottom: 1px solid #e4e7ee;
  text-align: left;
}
.module-table th {
  color: #6b7483;
  font-size: 12px;
}
.module-table small {
  display: block;
  margin-top: 6px;
  color: #647084;
}
.module-table td:last-child {
  min-width: 190px;
}
.module-table button {
  margin: 3px;
  min-height: 38px;
}
.module-status {
  display: inline-flex;
  padding: 4px 8px;
  background: #f1f3f7;
  border-radius: 5px;
  font-size: 12px;
}
.module-status.approved,
.module-status.confirmed,
.module-status.active {
  background: #e8f4eb;
  color: #146834;
}
.module-status.pending,
.module-status.estimated {
  background: #fff0d2;
  color: #765607;
}
.module-status.cancelled,
.module-status.rejected {
  background: #f8e6e6;
  color: #8c3030;
}
.module-warning {
  background: #fff5d9;
  border: 1px solid #f1dca6;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  font-size: 13px;
}
.module-warning p {
  margin: 4px 0;
}
.module-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.module-list > article {
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 9px;
  padding: 18px;
}
.module-list h3 {
  margin-top: 0;
}
.module-history {
  border-bottom: 1px solid #e0e4ed;
  padding: 12px 0;
}
.module-repeat {
  border: 1px solid #dce1e9;
  border-radius: 8px;
  margin: 12px 0;
  padding: 16px;
}
.module-allocation {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  border-top: 1px solid #e3e7ee;
  margin-top: 10px;
  padding-top: 12px;
}
.module-allocation label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 220px;
}
.module-tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.module-tool-cards button {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 9px;
  padding: 18px;
}
.module-tool-cards span {
  font-size: 12px;
  color: #6c7484;
}
.team-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.team-weekday {
  text-align: center;
  color: #667085;
  font-size: 12px;
  padding: 6px;
}
.team-calendar-day {
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 8px;
  min-height: 64px;
  padding: 8px;
  min-width: 0;
}
.team-calendar-day h3 {
  margin: 0 0 5px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.team-calendar-day h3 small {
  display: none;
  font-size: 10px;
  font-weight: 400;
  color: #778093;
}
.team-calendar-day.weekend {
  background: #f8f9fc;
}
.team-calendar-day.today {
  border-color: #2d68d2;
  box-shadow: 0 0 0 1px #2d68d2;
}
.team-day-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}
.team-day-preview:hover {
  background: transparent;
}
.team-person-chip {
  display: block;
  border-left: 3px solid var(--person-color);
  background: var(--person-tint);
  color: var(--person-color);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.team-person-chip.has-hours {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.team-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-person-hours {
  flex-shrink: 0;
  max-width: 70%;
  font-size: 10px;
  font-weight: 500;
  white-space: normal;
}
.team-person-color-0 {
  --person-color: #315c9b;
  --person-tint: #eaf1fc;
}
.team-person-color-1 {
  --person-color: #496a38;
  --person-tint: #edf5e7;
}
.team-person-color-2 {
  --person-color: #875030;
  --person-tint: #fff0e5;
}
.team-person-color-3 {
  --person-color: #765198;
  --person-tint: #f3ebfb;
}
.team-person-color-4 {
  --person-color: #216970;
  --person-tint: #e7f4f5;
}
.team-person-color-5 {
  --person-color: #9a4361;
  --person-tint: #fcecf2;
}
.team-more-people {
  font-size: 11px;
  color: #667085;
  padding: 2px 6px;
}
.team-day-people {
  display: grid;
  gap: 12px;
}
.team-person-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e4e7ee;
}
.team-person-detail > span:nth-child(2) {
  color: #667085;
  font-size: 13px;
}
.team-person-detail .team-person-chip {
  white-space: normal;
}
.team-no-absence {
  font-size: 11px;
  color: #8b92a1;
}
.team-calendar.agenda {
  display: block;
}
.team-calendar.agenda .team-weekday,
.team-calendar.agenda .team-calendar-blank {
  display: none;
}
.team-calendar.agenda .team-calendar-day {
  min-height: unset;
  margin: 8px 0;
}
.team-calendar.agenda .team-calendar-day:has(.team-no-absence) {
  display: none;
}
.team-calendar.agenda .team-calendar-day h3 small {
  display: inline;
}
.team-calendar.week {
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  overflow-x: auto;
}
.team-calendar.week .team-calendar-day {
  min-height: 80px;
}
.module-card table {
  width: 100%;
  border-collapse: collapse;
}
.module-card td,
.module-card th {
  padding: 10px;
  border-bottom: 1px solid #e4e7ee;
  text-align: left;
  vertical-align: top;
}
.team-view dialog {
  max-width: 1100px;
}
.module-view details {
  margin: 14px 0;
}
.module-view summary {
  cursor: pointer;
  font-weight: 600;
}
.module-view .pricing-tabs:has(button:only-child) {
  display: none;
}
.module-view .pricing-toolbar {
  flex-wrap: wrap;
}
.module-view .pricing-table-scroll {
  max-width: 100%;
}
@media (max-width: 800px) {
  .module-toolbar label {
    flex: 1 1 150px;
  }
  .module-toolbar button,
  .module-tabs button {
    min-height: 44px;
  }
  .module-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .module-metric {
    padding: 13px;
  }
  .module-metric strong {
    font-size: 17px;
  }
  .module-list {
    grid-template-columns: 1fr;
  }
  .team-calendar,
  .team-calendar.week {
    display: block;
    overflow: visible;
  }
  .team-weekday,
  .team-calendar-blank {
    display: none;
  }
  .team-calendar-day {
    min-height: 0;
    margin: 10px 0;
  }
  .team-no-absence {
    display: none;
  }
  .team-calendar-day:has(.team-no-absence) {
    display: none;
  }
  .team-calendar-day h3 small {
    display: inline;
    font-size: 12px;
  }
  .team-calendar.week .team-calendar-day {
    min-height: 0;
  }
  .financial-details > summary {
    padding: 16px 13px;
  }
  .financial-details-body {
    padding: 4px 12px 12px;
  }
  .module-table {
    min-width: 650px;
  }
  .module-card .block-body {
    padding: 12px;
  }
  .module-allocation label {
    max-width: none;
    width: 100%;
  }
  .module-card .block-head {
    padding: 14px;
  }
  .module-tool-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 450px) {
  .module-metrics {
    grid-template-columns: 1fr;
  }
  .module-tabs {
    gap: 5px;
  }
  .module-tabs button {
    padding: 8px 10px;
    font-size: 13px;
  }
  .module-tool-cards {
    grid-template-columns: 1fr;
  }
}

.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}
@media (max-width: 800px) {
  body.module-mobile-shell {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  .module-mobile-shell .workspace {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }
  .module-mobile-shell .topbar {
    padding: 0 12px;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
  }
  .module-mobile-shell .topbar .global-search {
    display: none;
  }
  .module-mobile-shell .profile {
    gap: 4px;
    min-width: 0;
  }
  .module-mobile-shell #profile-name {
    max-width: 138px;
    overflow: hidden;
  }
  .module-mobile-shell .profile button {
    margin-left: 0;
  }
  .module-mobile-shell .app-content {
    padding: 16px 12px;
    min-width: 0;
    max-width: 100%;
  }
  .module-mobile-shell #view,
  .module-mobile-shell .module-view {
    min-width: 0;
    max-width: 100%;
  }
  .module-mobile-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    max-width: 85vw;
    transform: translateX(-100%);
    z-index: 101;
  }
  .module-mobile-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  .module-mobile-shell .mobile-menu-toggle {
    display: block;
    font-size: 21px;
    min-width: 42px;
    height: 42px;
  }
  .module-mobile-shell .mobile-menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #17223766;
    z-index: 100;
  }
  .module-mobile-shell dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: auto;
    padding: 16px;
  }
  .module-mobile-shell dialog .dialog-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .module-mobile-shell .table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }
  .module-mobile-shell .module-filters > *,
  .module-mobile-shell .module-toolbar > * {
    max-width: 100%;
  }
  .module-mobile-shell .module-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .module-mobile-shell .module-metrics.financial-primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* OS shop administration only; storefront lives separately in apps/shop. */
.shop-product-section {
  margin: 16px 0;
}
.shop-product-section > summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 700;
}
.shop-editor-field {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  min-width: 0;
}
.shop-editor-field > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px;
}
.shop-editor-field > .field {
  margin-top: 8px;
}
.shop-editor-field textarea,
.shop-editor-field input:not([type="checkbox"]),
.shop-editor-field select {
  max-width: 100%;
  width: 100%;
}
.shop-editor-field > button,
.shop-editor-field > input {
  margin: 6px 4px 6px 0;
}
.shop-editor-item {
  margin: 12px 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.shop-editor-item .table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* Supplier source stays inert and bounded within the existing product card. */
.pmp-source-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 18rem;
  overflow: auto;
}
.pmp-state-label {
  font-weight: normal;
}
.pmp-status.red {
  background: #fce8e6;
  color: #9f1c12;
}
.pmp-status.yellow {
  background: #fff3cd;
  color: #664d03;
}
.pmp-status.green {
  background: #e1f3e8;
  color: #146c43;
}

/* Single matrix for Winder accessories, using the existing OS product catalogue. */
.winder-bases-dialog {
  width: min(1200px, 96vw);
  max-width: 96vw;
}
.winder-bases-tools {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}
.winder-bases-tools .field {
  flex: 1;
  min-width: 180px;
}
.winder-bases-scroll {
  max-height: 48vh;
  overflow: auto;
  border: 1px solid #e2e7e2;
  border-radius: 10px;
}
.winder-bases-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}
.winder-bases-table thead {
  position: sticky;
  top: 0;
  background: #f4f7f4;
  z-index: 1;
}
.winder-bases-table th,
.winder-bases-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e7e2;
  text-align: center;
}
.winder-bases-table th:first-child {
  text-align: left;
  min-width: 240px;
}
.winder-bases-table th small {
  display: block;
  color: #69756a;
  font-weight: 400;
  margin-top: 4px;
}
.winder-bases-table input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: #44883c;
}
.winder-bases-table input[type="number"] {
  width: 78px;
}
.winder-bases-table select {
  min-width: 150px;
}
.winder-bases-table select,
.winder-bases-table input[type="number"] {
  border: 1px solid #cdd6cd;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.shop-hub {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
}
.shop-hub-nav {
  background: #fff;
  border: 1px solid #e2e6df;
  border-radius: 12px;
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 20px;
}
.shop-hub-nav h2 {
  font-size: 17px;
  margin: 0 0 20px;
}
.shop-hub-nav > a {
  display: block;
  padding: 11px 12px;
  text-decoration: none;
  color: #41503e;
  border-radius: 8px;
  font-size: 14px;
}
.shop-hub-nav > a[aria-current] {
  background: #edf3e8;
  font-weight: 650;
}
.shop-hub-nav > a:hover {
  background: #f4f5f2;
}
.shop-hub-body {
  min-width: 0;
}
.shop-hub-body h1 {
  margin-top: 0;
}
.shop-hub-card {
  padding: 24px;
  margin-bottom: 20px;
}
.shop-hub-card h2 {
  font-size: 19px;
}
.shop-hub-card p {
  line-height: 1.65;
}
.shop-hub-card label {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.shop-hub-card input:not([type="checkbox"]),
.shop-hub-card select,
.shop-hub-body input[type="search"] {
  border: 1px solid #d3dbcf;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
  font: inherit;
}
.shop-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.shop-hub-stats article {
  display: grid;
  gap: 8px;
  padding: 24px;
  background: #fff;
  border: 1px solid #e0e6dc;
  border-radius: 12px;
}
.shop-hub-stats strong {
  font-size: 32px;
}
.shop-hub-content-list {
  display: grid;
  gap: 10px;
}
.shop-hub-content-list button {
  text-align: left;
}
.shop-hub-content-list small,
.shop-hub table small {
  display: block;
  font-size: 12px;
  color: #64735e;
}
.shop-hub table {
  width: 100%;
  border-collapse: collapse;
}
.shop-hub td,
.shop-hub th {
  padding: 12px;
  text-align: left;
}
.shop-delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.shop-delivery-grid > form {
  border: 1px solid #dfe5da;
  border-radius: 10px;
  padding: 18px;
}
.shop-delivery-grid fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
.shop-url-row {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 12px 0;
}
.shop-url-row label {
  flex: 1;
  min-width: 0;
}
@media (max-width: 900px) {
  .shop-hub {
    grid-template-columns: 1fr;
  }
  .shop-hub-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .shop-hub-nav h2 {
    width: 100%;
  }
  .shop-hub-stats,
  .shop-delivery-grid {
    grid-template-columns: 1fr;
  }
  .shop-url-row {
    flex-wrap: wrap;
  }
}

.shop-wide-dialog {
  width: min(1250px, calc(100vw - 32px));
  max-width: 1250px;
}
.shop-wide-dialog .dialog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.shop-editor-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 20px;
  position: sticky;
  top: 0;
  background: var(--surface, #fff);
  padding: 12px 0;
  z-index: 2;
}
.shop-editor-tabs button[aria-current="page"] {
  border-color: #178649;
  background: #edf8f0;
  font-weight: 700;
}
.shop-wide-dialog .shop-editor-field {
  padding: 12px;
  min-width: 0;
  border-radius: 10px;
}
.shop-wide-dialog .shop-editor-field > span {
  display: block;
  font-weight: 650;
  margin-bottom: 6px;
}
.shop-wide-dialog .shop-editor-field:has(> [data-editor-path]) {
  border: 0;
}
.shop-category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 18px;
  margin: 16px 0;
  border: 1px solid #dce4df;
  border-radius: 12px;
}
.shop-category-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-addon-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1fr 90px minmax(160px, 1.2fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e4e8e5;
}
.shop-addon-row label {
  display: grid;
  gap: 6px;
}
.shop-addon-row label:first-child {
  display: block;
}
.shop-addon-row small {
  display: block;
  margin-top: 5px;
}
@media (max-width: 700px) {
  .shop-wide-dialog .dialog-grid {
    grid-template-columns: 1fr;
  }
  .shop-addon-row {
    grid-template-columns: 1fr 1fr;
  }
}

.product-photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.product-photo-toolbar h3 {
  margin: 0;
  font-size: 18px;
}
.product-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.product-photo-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce4df;
  border-radius: 12px;
  background: #fff;
}
.product-photo-preview {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #eef1ef;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 12px;
}
.product-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-photo-preview > span:not(.product-photo-main) {
  color: #68736c;
  font-size: 13px;
}
.product-photo-main {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #edf8f0;
  color: #176b39;
  font-size: 12px;
  font-weight: 650;
}
.product-photo-actions,
.product-photo-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.product-photo-actions button,
.product-photo-order button {
  padding: 7px 10px;
  font-size: 12px;
}
.product-photo-card > .field {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  font-size: 13px;
}
.product-photo-card input,
.product-photo-card select {
  width: 100%;
  min-width: 0;
}
.product-photo-card .product-panel-note {
  font-size: 12px;
}
.product-photo-status {
  white-space: pre-line;
  margin: 12px 0;
}
.product-photo-status:empty {
  display: none;
}
.product-photo-advanced {
  margin: 10px 0 20px;
  font-size: 13px;
}
@media (max-width: 900px) {
  .product-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .product-photo-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep product names and movement controls aligned in every category editor. */
.shop-category-product-order {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.shop-category-product-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}
.shop-category-product-order-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
