/* Workspace skin: the clean white look from design option 2, for the light theme only.
   Colours, borders and type only. It does not move or resize anything, so every screen keeps working.
   Also shipped on its own to the live site. */

html:not([data-theme="dark"]) body {
  background: #fff;
}

/* Cards: white, thin border, no heavy shadow */
html:not([data-theme="dark"]) .workspace .panel {
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  box-shadow: none;
}

html:not([data-theme="dark"]) .workspace .panel > .panel-head {
  background: #fff;
}

html:not([data-theme="dark"]) .workspace h1,
html:not([data-theme="dark"]) .workspace h2,
html:not([data-theme="dark"]) .workspace h3 {
  font-weight: 700;
  letter-spacing: 0;
}

/* Left menu */
html:not([data-theme="dark"]) aside.sidebar {
  background: #fff;
  border: 1px solid #e1e5e9;
  box-shadow: none;
  backdrop-filter: none;
}

html:not([data-theme="dark"]) aside.sidebar nav button {
  border-color: transparent;
  font-weight: 600;
}

html:not([data-theme="dark"]) aside.sidebar nav button.active {
  background: #e6f4f3;
  border-color: transparent;
  box-shadow: inset 3px 0 0 #007f80;
  color: #006365;
  font-weight: 700;
}

/* Top bar */
html:not([data-theme="dark"]) .operations-bar {
  background: #fff;
  border-bottom: 1px solid #e1e5e9;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Pickup jobs list */
html:not([data-theme="dark"]) .job-list .panel-head h2 {
  font-size: 18px;
  line-height: 1.3;
}

html:not([data-theme="dark"]) .job-list .table-control-bar,
html:not([data-theme="dark"]) .job-list .bulk-toolbar {
  background: #fff;
}

html:not([data-theme="dark"]) .job-list .quick-filters button {
  background: #fff;
  border: 1px solid #c9d0d6;
  color: #16202a;
  font-weight: 600;
}

html:not([data-theme="dark"]) .job-list .quick-filters button strong {
  background: #f0f3f5;
  color: #4d5c69;
  font-weight: 700;
}

html:not([data-theme="dark"]) .job-list .quick-filters button.active {
  background: #007f80;
  border-color: #007f80;
  color: #fff;
}

html:not([data-theme="dark"]) .job-list .quick-filters button.active strong {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

html:not([data-theme="dark"]) .job-list table thead tr,
html:not([data-theme="dark"]) .job-list table tbody tr {
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html:not([data-theme="dark"]) .job-list table th {
  background: #f5f7f8;
  border-bottom: 1px solid #e1e5e9;
  border-radius: 0;
  color: #4d5c69;
  font-size: 12px;
  font-weight: 600;
}

html:not([data-theme="dark"]) .job-list table td {
  background: #fff;
  border-bottom: 1px solid #e1e5e9;
  border-radius: 0;
}

html:not([data-theme="dark"]) .job-list table tbody tr:hover td {
  background: #f5f7f8;
}

html:not([data-theme="dark"]) .job-list table tbody tr.selected td {
  background: #e6f4f3;
}

html:not([data-theme="dark"]) .job-list table.has-select-column tbody td:nth-child(2) {
  color: #006365;
  font-weight: 600;
}

/* Record panel */
html:not([data-theme="dark"]) .detail-panel > .panel-head h2 {
  font-size: 22px;
  line-height: 1.2;
}

html:not([data-theme="dark"]) .detail-panel > .panel-head span {
  font-size: 13px;
}

html:not([data-theme="dark"]) .detail-panel .fast-actions {
  background: #fff;
}

html:not([data-theme="dark"]) .detail-panel .fast-actions button {
  background: #fff;
  border: 1px solid #c9d0d6;
  border-radius: 6px;
  font-weight: 600;
}

html:not([data-theme="dark"]) .detail-panel .fast-actions button:hover:not(:disabled) {
  background: #f5f7f8;
  color: #16202a;
}

html:not([data-theme="dark"]) .detail-panel .client-card {
  background: #fff;
}

/* Dashboard cards */
html:not([data-theme="dark"]) .workspace .erp-command-main,
html:not([data-theme="dark"]) .workspace .erp-sync-panel,
html:not([data-theme="dark"]) .workspace .dashboard-alert-card,
html:not([data-theme="dark"]) .workspace .dashboard-reminder-panel,
html:not([data-theme="dark"]) .workspace .erp-panel {
  background-color: #fff;
  border-color: #e1e5e9;
  box-shadow: none;
}

html:not([data-theme="dark"]) .workspace .dashboard-alert-card {
  border-radius: 8px;
}

html:not([data-theme="dark"]) .workspace .table-pagination {
  background: #fff;
}

html:not([data-theme="dark"]) .workspace select,
html:not([data-theme="dark"]) .workspace input:not([type="checkbox"]):not([type="radio"]) {
  background-color: #fff;
}

/* Keep the name box in the top bar from sitting over the page on mid-size windows. */
@media (min-width: 1051px) and (max-width: 1560px) {
  .user-pill > div {
    display: none;
  }
}

html:not([data-theme="dark"]) {
  background: #fff;
}

/* ------------------------------------------------------------------
   Top menu (wide screens only). The left menu becomes one bar across
   the top. Below 1180px the normal left menu and phone menu are kept.
   ------------------------------------------------------------------ */
@media (min-width: 1180px) {
  .app-shell aside.sidebar,
  .app-shell.sidebar-hidden aside.sidebar {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 56px;
    margin: 0;
    padding: 0 16px;
    overflow: visible;
    border-width: 0 0 1px;
    border-radius: 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .app-shell aside.sidebar .brand {
    flex: 0 0 auto;
    margin: 0 10px 0 0;
    padding: 0;
    border: 0;
  }

  .app-shell aside.sidebar .brand img {
    width: auto;
    height: 34px;
  }

  .app-shell aside.sidebar .sidebar-toggle,
  .app-shell aside.sidebar .sidebar-theme-picker,
  .app-shell .app-footer {
    display: none;
  }

  .app-shell aside.sidebar nav {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    height: 56px;
    overflow: visible;
  }

  .app-shell aside.sidebar nav > button,
  .app-shell aside.sidebar nav > .nav-group > button {
    flex: 0 0 auto;
    width: auto;
    height: 56px;
    min-height: 0;
    padding: 0 11px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 13.5px;
    white-space: nowrap;
  }

  .app-shell aside.sidebar nav > button > svg,
  .app-shell aside.sidebar nav > .nav-group > button > svg:first-child {
    display: none;
  }

  .app-shell aside.sidebar nav > button.active,
  .app-shell aside.sidebar nav > .nav-group > button.active,
  html:not([data-theme="dark"]) .app-shell aside.sidebar nav > button.active,
  html:not([data-theme="dark"]) .app-shell aside.sidebar nav > .nav-group > button.active {
    border-bottom-color: #007f80;
    background: none;
    box-shadow: none;
  }

  .app-shell aside.sidebar nav .nav-count {
    margin-left: 6px;
  }

  /* Settings opens as a drop-down under the bar. */
  .app-shell aside.sidebar nav .nav-group {
    position: relative;
    display: block;
  }

  .app-shell aside.sidebar nav .nav-group .nav-submenu,
  .app-shell aside.sidebar nav .nav-group.expanded .nav-submenu {
    position: absolute;
    top: 56px;
    left: 0;
    z-index: 41;
    display: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    width: 250px;
    max-height: calc(100vh - 80px);
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(22, 32, 42, 0.14);
  }

  .app-shell aside.sidebar nav .nav-group:hover .nav-submenu,
  .app-shell aside.sidebar nav .nav-group:has(:focus-visible) .nav-submenu {
    display: grid;
  }

  .app-shell aside.sidebar nav .nav-submenu button {
    width: 100%;
    min-height: 38px;
    justify-content: flex-start;
    white-space: nowrap;
  }

  html[data-theme="dark"] .app-shell aside.sidebar nav .nav-group .nav-submenu {
    border-color: rgba(255, 255, 255, 0.14);
    background: #0d1b2a;
  }

  .app-shell main.workspace,
  .app-shell.sidebar-hidden main.workspace {
    width: 100%;
    height: calc(100vh - 56px);
    margin: 56px 0 0;
  }

  .app-shell .operations-bar {
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }
}

/* ------------------------------------------------------------------
   Simpler dashboard: Pickup jobs first, summary cards after it,
   and less heading text.
   ------------------------------------------------------------------ */
.dashboard-layout.dashboard-erp > .work-grid {
  order: -1;
}

.workspace header.topbar {
  margin-bottom: 14px;
}

.workspace header.topbar h1 {
  font-size: 22px;
  line-height: 1.25;
}

.workspace header.topbar h1 + p,
.erp-command-main > .erp-kicker,
.erp-command-main > .erp-kicker + h2,
.erp-command-main > .erp-kicker + h2 + p {
  display: none;
}

/* Pickup jobs list: the bulk-action row shows only after a record is ticked. */
.job-list:not(:has(tbody input[type="checkbox"]:checked)):not(:has(.bulk-toolbar input:checked)) .bulk-toolbar {
  display: none;
}

html:not([data-theme="dark"]) .job-list table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Text: nothing heavier than bold, nothing smaller than 12px in the work area. */
html:not([data-theme="dark"]) .workspace strong,
html:not([data-theme="dark"]) .workspace b,
html:not([data-theme="dark"]) .workspace th,
html:not([data-theme="dark"]) .workspace button,
html:not([data-theme="dark"]) .workspace label {
  font-weight: 700;
}

html:not([data-theme="dark"]) .workspace dt,
html:not([data-theme="dark"]) .workspace small,
html:not([data-theme="dark"]) .workspace .erp-kicker {
  font-size: 12px;
}

html:not([data-theme="dark"]) .app-shell {
  background: #fff;
}

@media (min-width: 1180px) {
  .app-shell aside.sidebar .brand img {
    width: 52px;
    height: 34px;
    object-fit: contain;
  }
}

@media (min-width: 1180px) {
  .app-shell .sidebar-reveal {
    display: none;
  }
}

/* ------------------------------------------------------------------
   Readability (17 Nov): bigger text, taller rows, and on very wide
   screens the work area stops growing so columns stay close together.
   ------------------------------------------------------------------ */
@media (min-width: 1051px) {
  .workspace > * {
    width: 100%;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
  }

  .workspace > .operations-bar {
    max-width: none;
  }

  /* List and record share the width more evenly. */
  .work-grid {
    grid-template-columns: minmax(0, 1fr) minmax(600px, 0.85fr);
    gap: 16px;
  }

  /* The list is only as tall as its rows, up to one screen. */
  .work-grid > .job-list {
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 150px);
  }
}

/* Pickup jobs list */
html:not([data-theme="dark"]) .job-list .panel-head h2 {
  font-size: 20px;
}

.job-list table th {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.job-list table td {
  font-size: 15px;
  line-height: 1.4;
  vertical-align: middle;
}

html:not([data-theme="dark"]) .job-list table td {
  padding-top: 15px;
  padding-bottom: 15px;
}

.job-list table td strong,
.job-list table td b {
  font-size: 15px;
}

.job-list table td small,
.job-list table td span:not([class*="status"]) {
  font-size: 13px;
}

.job-list table td [class*="status"],
.job-list table td .badge {
  font-size: 13px;
  padding: 4px 10px;
}

.job-list .quick-filters button {
  min-height: 38px;
  font-size: 14px;
}

.job-list .table-pagination,
.job-list .table-control-bar {
  font-size: 14px;
}

/* Record panel */
html:not([data-theme="dark"]) .detail-panel > .panel-head h2 {
  font-size: 26px;
}

.detail-panel > .panel-head span {
  font-size: 14px;
}

.detail-panel .fast-actions button {
  min-height: 46px;
  font-size: 14px;
}

.record-workspace .record-path li {
  height: 38px;
  font-size: 14px;
  line-height: 38px;
}

.record-workspace .record-next strong {
  font-size: 16px;
}

.record-workspace .record-next span {
  font-size: 14px;
}

@media (min-width: 721px) {
  .record-workspace .mobile-detail-tabs button {
    min-height: 48px;
    font-size: 15px;
  }
}

.detail-panel .client-card dt {
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

.detail-panel .client-card dd {
  font-size: 16px;
  line-height: 1.45;
}

/* Keep CNID, date, status and amount on one line; only the client name may wrap. */
.job-list table.has-select-column th:not(:nth-child(3)),
.job-list table.has-select-column td:not(:nth-child(3)) {
  white-space: nowrap;
}

.job-list table td [class*="status"] {
  white-space: nowrap;
}

@media (min-width: 1051px) and (max-width: 1500px) {
  .work-grid {
    grid-template-columns: minmax(0, 1fr) minmax(500px, 0.8fr);
  }

  .job-list table td {
    font-size: 14px;
  }

  .job-list table th,
  .job-list table td {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (min-width: 1051px) and (max-width: 1500px) {
  .record-workspace .record-path li {
    padding: 0 6px 0 14px;
    font-size: 12.5px;
  }

  .record-workspace .record-path li:first-child {
    padding-left: 8px;
  }
}

/* ------------------------------------------------------------------
   Client box, design A (17 Nov): one line per item, label on the left.
   Order: site, address, contact, email, dates, tags.
   ------------------------------------------------------------------ */
.detail-panel .client-card {
  padding: 6px 20px 10px;
}

.detail-panel .client-card dl {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-panel .client-card dl > div,
.detail-panel .client-card dl > div:first-child,
.detail-panel .client-card dl > .pickup-contact-detail {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  grid-column: auto;
  margin: 0;
  padding: 9px 0;
  border-top: 1px solid var(--line, #e1e5e9);
}

.detail-panel .client-card dl > div:nth-child(1) { order: 1; border-top: 0; }
.detail-panel .client-card dl > div:nth-child(2) { order: 2; }
.detail-panel .client-card dl > .pickup-contact-detail { order: 3; }
.detail-panel .client-card dl > div:nth-child(3) { order: 4; }
.detail-panel .client-card dl > div:nth-child(n + 5) { order: 5; }
.detail-panel .client-card dl:has(> div:nth-child(7)) > div:nth-child(5) { order: 9; }

.detail-panel .client-card dt {
  margin: 0;
  color: var(--muted, #5f7080);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.detail-panel .client-card dd {
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Contact: name and Primary on one line, phone link under it, no inner box. */
.detail-panel .pickup-contact-detail-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.detail-panel .pickup-contact-detail-list article,
html[data-theme="dark"] .detail-panel .pickup-contact-detail-list article {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.detail-panel .pickup-contact-detail-list article > div {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.detail-panel .pickup-contact-detail-list article strong {
  font-size: 15px;
  font-weight: 600;
}

.detail-panel .pickup-contact-detail-list article span {
  padding: 1px 7px;
  font-size: 10.5px;
}

.detail-panel .client-card .client-contact-button {
  min-height: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.detail-panel .client-card .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
