/*
 * Operational collection polish
 * --------------------------------------------------------------------------
 * A final, scoped visual layer for the core working screens.  The app has
 * several generations of controls in its stylesheet; keeping these rules at
 * the end makes the search, filtering, and record surfaces feel like one
 * product without changing their markup or behaviour.
 */

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) {
  --ops-control-height: 48px;
  --ops-control-radius: 14px;
  --ops-panel-radius: 20px;
  --ops-card-radius: 22px;
  --ops-control-border: color-mix(in srgb, var(--line, #e4ebf1) 88%, #b6c9d8);
  --ops-card-border: color-mix(in srgb, var(--line, #e4ebf1) 92%, #c5d5e1);
  --ops-control-shadow: 0 7px 18px rgba(47, 76, 101, .055);
  --ops-card-shadow: 0 12px 28px rgba(47, 76, 101, .075);
}

/* Shared search and filter surface --------------------------------------- */
:is(#screen-main, #screen-projects, #screen-all-tasks) .collection-toolbar,
#screen-warehouse .wh-filter-bar,
#screen-quotations .q-filter-bar {
  position: relative;
  align-items: center;
  min-width: 0;
  min-height: 68px;
  margin-block: 0 !important;
  padding: 9px !important;
  gap: 10px !important;
  overflow: visible;
  border: 1px solid var(--ops-card-border);
  border-radius: var(--ops-panel-radius);
  background: linear-gradient(145deg, var(--surface, #fff), var(--surface-soft, #f5f8fb));
  box-shadow: var(--ops-control-shadow);
}

#screen-main .collection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
}

#screen-projects .collection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

#screen-all-tasks .collection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
}

#screen-warehouse .wh-filter-bar,
#screen-quotations .q-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .search-box {
  display: flex;
  align-items: center;
  min-width: 0 !important;
  min-height: var(--ops-control-height);
  padding-inline: 14px !important;
  gap: 10px;
  color: var(--ink-soft, #718293);
  border: 1px solid var(--ops-control-border) !important;
  border-radius: var(--ops-control-radius) !important;
  background: var(--surface-soft, #f5f8fb) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .search-box svg {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  color: var(--blue-gray, #718ba3);
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .search-box input {
  width: 100%;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 30px;
  padding: 0 !important;
  color: var(--ink, #344f67) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 13px;
  outline: 0;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .search-box input::placeholder {
  color: var(--ink-muted, #9aa9b6);
  opacity: 1;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .search-box:focus-within {
  border-color: color-mix(in srgb, var(--navy, #426482) 60%, white) !important;
  background: var(--surface, #fff) !important;
  box-shadow: 0 0 0 4px rgba(66, 100, 130, .12), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) :is(select.filter-select, input.filter-select) {
  width: 100%;
  min-width: 0;
  min-height: var(--ops-control-height) !important;
  height: var(--ops-control-height);
  padding: 0 40px 0 13px !important;
  color: var(--ink, #344f67) !important;
  border: 1px solid var(--ops-control-border) !important;
  border-radius: var(--ops-control-radius) !important;
  background-color: var(--surface-soft, #f5f8fb) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) select.filter-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718ba3' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 16px !important;
}

html[dir='rtl'] :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) :is(select.filter-select, input.filter-select) {
  padding: 0 13px 0 40px !important;
}

html[dir='rtl'] :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) select.filter-select {
  background-position: left 13px center !important;
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) :is(select.filter-select, input.filter-select):focus {
  border-color: color-mix(in srgb, var(--navy, #426482) 60%, white) !important;
  background-color: var(--surface, #fff) !important;
  box-shadow: 0 0 0 4px rgba(66, 100, 130, .12), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

#screen-main .collection-filters {
  gap: 10px !important;
  margin-top: 10px !important;
  padding: 10px !important;
  border-color: var(--ops-card-border) !important;
  border-radius: 18px !important;
  background: color-mix(in srgb, var(--surface-blue, #edf4fa) 74%, var(--surface, #fff)) !important;
  box-shadow: none !important;
}

#screen-main .collection-filters .filter-select {
  min-height: 46px !important;
  height: 46px;
}

#screen-main .collection-toolbar .filter-toggle-btn {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid var(--ops-control-border);
  border-radius: var(--ops-control-radius);
  background: var(--surface-blue, #edf4fa);
  box-shadow: none;
}

#screen-main .collection-toolbar .filter-toggle-btn:hover,
#screen-main .collection-toolbar .filter-toggle-btn[aria-expanded='true'] {
  color: #fff;
  border-color: var(--navy, #426482);
  background: var(--navy, #426482);
}

:is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
    #screen-warehouse, #screen-quotations) .pg-tab-btn {
  min-height: 44px;
}

/* Record cards ------------------------------------------------------------ */
:is(#screen-main, #screen-projects) .record-grid > .pg-list-row,
:is(#screen-all-tasks, #screen-tasks) .record-grid > .pg-task-row,
#screen-warehouse :is(.wh-project-card, .wh-item-card),
#screen-quotations :is(.quotation-project-card, .quotation-item) {
  position: relative;
  isolation: isolate;
  min-width: 0;
  border-color: var(--ops-card-border) !important;
  background: linear-gradient(145deg, var(--surface, #fff), var(--surface-soft, #f5f8fb)) !important;
  box-shadow: var(--ops-card-shadow) !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

@media (hover: hover) and (pointer: fine) {
  :is(#screen-main, #screen-projects) .record-grid > .pg-list-row:hover,
  :is(#screen-all-tasks, #screen-tasks) .record-grid > .pg-task-row:hover,
  #screen-warehouse :is(.wh-project-card, .wh-item-card):hover,
  #screen-quotations :is(.quotation-project-card, .quotation-item):hover {
    border-color: color-mix(in srgb, var(--navy, #426482) 29%, var(--line, #e4ebf1)) !important;
    box-shadow: 0 16px 30px rgba(47, 76, 101, .12) !important;
    transform: translateY(-2px);
  }
}

:is(#screen-main, #screen-projects) .record-grid > .pg-list-row:focus-visible,
:is(#screen-all-tasks, #screen-tasks) .pg-task-link:focus-visible,
#screen-warehouse .wh-project-card:focus-visible,
#screen-quotations :is(.quotation-project-card, .quotation-item):focus-visible {
  outline: 3px solid rgba(66, 100, 130, .45);
  outline-offset: 3px;
}

:is(#screen-main, #screen-projects) .record-grid > .pg-list-row {
  min-height: 258px;
  border-radius: var(--ops-card-radius) !important;
}

:is(#screen-main, #screen-projects) .record-grid .pg-row-title {
  color: var(--ink, #344f67);
  font-size: 16px;
  letter-spacing: -.012em;
}

:is(#screen-main, #screen-projects) .record-grid .pg-row-meta,
:is(#screen-all-tasks, #screen-tasks) .record-grid .pg-task-meta {
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--line, #e4ebf1) 82%, #c8d8e4);
  background: color-mix(in srgb, var(--surface-soft, #f5f8fb) 76%, var(--surface, #fff));
}

:is(#screen-main, #screen-projects) .record-grid :is(.pg-row-meta, .pg-row-note, .pg-row-progress),
:is(#screen-all-tasks, #screen-tasks) .record-grid :is(.pg-task-heading, .pg-task-meta, .pg-task-body) {
  min-width: 0;
  overflow-wrap: anywhere;
}

:is(#screen-all-tasks, #screen-tasks) .record-grid > .pg-task-row {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  min-height: 192px;
  border-radius: var(--ops-card-radius) !important;
}

:is(#screen-all-tasks, #screen-tasks) .record-grid .pg-task-check {
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--navy, #426482) 36%, var(--line, #e4ebf1));
  background: var(--surface-blue, #edf4fa);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

:is(#screen-all-tasks, #screen-tasks) .record-grid .pg-task-check.checked {
  border-color: var(--success, #38a169);
  background: var(--success, #38a169);
}

:is(#screen-all-tasks, #screen-tasks) .record-grid .pg-task-heading {
  color: var(--ink, #344f67);
  font-size: 15px;
  letter-spacing: -.008em;
}

:is(#screen-all-tasks, #screen-tasks) .record-grid .pg-task-meta {
  gap: 6px;
  border-radius: 13px;
}

:is(#screen-all-tasks, #screen-tasks) .record-grid .avatar-stack {
  padding-top: 2px;
}

:is(#screen-all-tasks, #screen-tasks) .record-grid :is(.task-delete-btn, .task-return-delete-btn) {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--line, #e4ebf1) 86%, #c3d4df);
  background: var(--surface-soft, #f5f8fb);
}

/* Warehouse and quotation lists are always a single, full-width stacked
   column — one card per row at every viewport width — so every card can
   show its full details without being squeezed into a multi-column grid
   cell. Switched from CSS Grid (grid-auto-rows:auto) to a plain flex
   column: with grid, these lists sit inside a height-constrained,
   overflow-y:auto scroll container (.q-list/.wh-list, flex:1 1 auto;
   min-height:0), and browsers can resolve "auto" grid row tracks to a
   size far smaller than the row's actual content in that situation
   (observed: every row collapsed to ~42px regardless of content, while
   the same content correctly measured 200px+ tall) — a real CSS Grid
   auto-track-sizing-inside-a-constrained-scroll-container quirk, not
   something worth fighting rule-by-rule. A single-column list has no
   equal-width-row/multi-column feature that actually needs Grid, so flex
   removes the ambiguity entirely: each card is simply sized to its own
   content, full stop. This intentionally overrides (and wins the cascade
   tie against, since this file loads last) the older grid-based rules
   still present in operations-layout.css. */
#screen-warehouse :is(.wh-project-list, .wh-items-list),
#screen-quotations :is(.q-project-list, .q-quotation-list) {
  display: flex !important;
  flex-direction: column !important;
}

#screen-warehouse :is(.wh-project-card, .wh-item-card),
#screen-quotations :is(.quotation-project-card, .quotation-item) {
  border-radius: var(--ops-card-radius) !important;
}

#screen-warehouse .wh-project-card,
#screen-quotations :is(.quotation-project-card, .quotation-item) {
  min-height: 166px;
}

#screen-warehouse .wh-item-card {
  min-height: 224px;
}

#screen-warehouse .wh-project-card__body,
#screen-warehouse .wh-item-card__body,
#screen-quotations :is(.quotation-project-card__body, .quotation-item__body) {
  min-width: 0;
}

#screen-warehouse .wh-project-card__name,
#screen-warehouse .wh-item-card__name,
#screen-quotations :is(.quotation-project-card__title, .quotation-item__number) {
  color: var(--ink, #344f67);
  letter-spacing: -.012em;
}

#screen-warehouse .wh-item-card__body {
  gap: 12px;
}

#screen-warehouse .wh-item-card__qty,
#screen-quotations .quotation-item__total {
  font-variant-numeric: tabular-nums;
}

#screen-warehouse .wh-item-card__qty {
  border: 1px solid color-mix(in srgb, var(--line, #e4ebf1) 72%, #bbd3e2);
  background: color-mix(in srgb, var(--surface-blue, #edf4fa) 76%, var(--surface, #fff));
}

#screen-warehouse .wh-item-card__actions {
  min-height: 60px;
  padding: 11px 16px;
  background: color-mix(in srgb, var(--surface-soft, #f5f8fb) 72%, var(--surface, #fff));
}

#screen-warehouse .wh-item-card__actions .btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--line, #e4ebf1) 84%, #c3d3df);
  background: var(--surface, #fff);
}

#screen-warehouse .wh-project-card__aside .btn-icon {
  width: 44px;
  height: 44px;
  min-height: 44px;
}

#screen-quotations .quotation-item__aside {
  min-width: 104px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line, #e4ebf1) 82%, #c8d9e4);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-blue, #edf4fa) 68%, var(--surface, #fff));
}

#screen-quotations .quotation-item__total {
  color: var(--navy, #426482);
  font-size: 15px;
}

#screen-quotations .quotation-item__meta-danger {
  color: var(--clr-danger, #ef4444);
  font-weight: 700;
}

#screen-quotations .quotation-item__breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--line, #e4ebf1) 70%, transparent);
  color: var(--ink-soft, #718293);
  font-size: 11px;
}

#screen-quotations .quotation-item__breakdown strong {
  color: var(--ink, #344f67);
  font-weight: 700;
}

/* Forms inside the warehouse and quotation operations use the same control
   height, radius, and focus treatment as the lists above. */
:is(#modal-wh-item-form, #modal-wh-transaction, #modal-q-form)
  :is(input:not([type='checkbox']):not([type='radio']), select, textarea) {
  min-width: 0;
  min-height: 48px;
  border-color: var(--ops-control-border, #d5e1ea) !important;
  border-radius: 13px !important;
  background: var(--surface-soft, #f5f8fb) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

:is(#modal-wh-item-form, #modal-wh-transaction, #modal-q-form)
  textarea {
  min-height: 112px;
  resize: vertical;
}

:is(#modal-wh-item-form, #modal-wh-transaction, #modal-q-form)
  :is(input:not([type='checkbox']):not([type='radio']), select, textarea):focus {
  border-color: color-mix(in srgb, var(--navy, #426482) 60%, white) !important;
  background: var(--surface, #fff) !important;
  box-shadow: 0 0 0 4px rgba(66, 100, 130, .12), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}

/* Keep the daily inspection routine visually in the same family as the
   collection screens.  This is intentionally presentation-only so the
   checklist workflow, schedules, and saved data stay untouched. */
:is(#screen-daily-checklist-templates, #screen-daily-checklist-my,
    #screen-daily-checklist-run, #screen-daily-checklist-form) {
  --routine-control-radius: 14px;
  --routine-card-radius: 20px;
  --routine-card-border: color-mix(in srgb, var(--line, #e4ebf1) 90%, #c3d3df);
}

:is(#screen-daily-checklist-templates, #screen-daily-checklist-my,
    #screen-daily-checklist-run, #screen-daily-checklist-form)
  :is(.dc-toolbar, .linked-item, .dcf-item-row, .dc-item-row) {
  border-color: var(--routine-card-border) !important;
  border-radius: var(--routine-card-radius) !important;
  box-shadow: 0 10px 24px rgba(47, 76, 101, .07);
}

#screen-daily-checklist-run .dc-progress-wrap {
  border-radius: var(--routine-card-radius);
  box-shadow: 0 14px 28px rgba(53, 83, 111, .17);
}

#screen-daily-checklist-run :is(.dc-item-check-btn, .dc-item-flag-btn),
#screen-daily-checklist-form .dcf-field-remove,
#screen-daily-checklist-templates .linked-item > div:last-child .btn {
  min-width: 44px;
  min-height: 44px;
}

#screen-daily-checklist-form .dcf-field-row {
  grid-template-columns: minmax(0, 2fr) minmax(110px, 1fr) 44px;
}

#screen-daily-checklist-run .dc-item-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

html[dir='rtl'] #screen-daily-checklist-run .dc-item-row {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

/* Multi-column desktop grid removed — see the unconditional
   grid-template-columns: minmax(0,1fr) !important rule above; lists stay
   single-column full-width stacked cards at every width now. */

@media (max-width: 680px) {
  :is(#screen-main, #screen-projects, #screen-all-tasks) .collection-toolbar,
  #screen-warehouse .wh-filter-bar,
  #screen-quotations .q-filter-bar {
    min-height: 64px;
    padding: 8px !important;
    border-radius: 18px;
  }

  #screen-all-tasks .collection-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
      #screen-warehouse, #screen-quotations) .search-box,
  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
      #screen-warehouse, #screen-quotations) :is(select.filter-select, input.filter-select) {
    min-height: 46px !important;
    height: 46px;
  }

  :is(#screen-main, #screen-projects) .record-grid > .pg-list-row,
  :is(#screen-all-tasks, #screen-tasks) .record-grid > .pg-task-row,
  #screen-warehouse :is(.wh-project-card, .wh-item-card),
  #screen-quotations :is(.quotation-project-card, .quotation-item) {
    min-height: 0;
    border-radius: 19px !important;
  }

  #screen-warehouse :is(.wh-project-list, .wh-items-list),
  #screen-quotations :is(.q-project-list, .q-quotation-list) {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  #screen-warehouse .wh-project-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
  }

  #screen-warehouse .wh-project-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  #screen-warehouse .wh-project-card__aside {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line, #e4ebf1);
  }

  #screen-warehouse .wh-item-card__body {
    padding: 16px;
    padding-inline-start: 20px;
  }

  #screen-quotations .quotation-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  #screen-quotations .quotation-item__aside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  #screen-quotations .quotation-item__meta {
    font-size: 12px;
  }

  #screen-quotations .quotation-item__breakdown {
    width: 100%;
    font-size: 12px;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid > .pg-task-row {
    grid-template-columns: 44px minmax(0, 1fr) auto auto;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid .pg-task-check {
    width: 44px;
    height: 44px;
  }

  #screen-daily-checklist-form .dcf-field-row {
    grid-template-columns: minmax(0, 1fr) 96px 44px;
  }
}

@media (max-width: 390px) {
  #screen-main .collection-toolbar {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
      #screen-warehouse, #screen-quotations) .search-box {
    padding-inline: 12px !important;
    gap: 8px;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
      #screen-warehouse, #screen-quotations) .search-box svg {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
  }

  #screen-warehouse .wh-item-card__header {
    gap: 8px;
  }

  #screen-warehouse .wh-item-card__qty {
    max-width: 48%;
    padding-inline: 8px;
    font-size: 11px;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid > .pg-task-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid :is(.task-return-delete-btn, .task-delete-btn) {
    grid-row: 2;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid .task-return-delete-btn {
    grid-column: 2;
    justify-self: end;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks)
    .record-grid .task-delete-btn {
    grid-column: 3;
  }

  #screen-daily-checklist-form .dcf-field-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  #screen-daily-checklist-run .dc-item-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 12px;
  }

  #screen-daily-checklist-run .dc-item-check-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 340px) {
  :is(#screen-main, #screen-projects, #screen-all-tasks) .collection-panel,
  #screen-tasks .pg-scroll-area,
  #screen-warehouse .wh-view-shell,
  #screen-quotations .q-view-shell {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  :is(#screen-main, #screen-projects, #screen-all-tasks, #screen-tasks,
      #screen-warehouse, #screen-quotations) :is(.search-box, .filter-select,
      .pg-list, .record-grid, .wh-list, .q-list) {
    min-width: 0 !important;
    max-width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Work Order Recurrence Panel & Animated Progress Bar
   ───────────────────────────────────────────────────────────────────────────── */
.wo-recurrence-card-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.wo-recurrence-card-panel:hover {
  background: rgba(14, 165, 233, 0.09);
  border-color: rgba(14, 165, 233, 0.32);
}

.wo-recurrence-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.wo-chip--interval {
  background: rgba(14, 165, 233, 0.14);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.28);
}

[data-theme="dark"] .wo-chip--interval {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.wo-chip--closed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.26);
}

[data-theme="dark"] .wo-chip--closed {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

.wo-chip--upcoming {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.26);
}

[data-theme="dark"] .wo-chip--upcoming {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

.wo-recurrence-progress-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 14px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 7px;
  overflow: hidden;
  margin-top: 2px;
}

[data-theme="dark"] .wo-recurrence-progress-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.wo-recurrence-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, #0284c7 0%, #10b981 100%);
  border-radius: 7px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

[dir="rtl"] .wo-recurrence-progress-bar {
  left: auto;
  right: 0;
  background: linear-gradient(270deg, #0284c7 0%, #10b981 100%);
}

.wo-progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: wo-shimmer-anim 2.2s infinite ease-in-out;
  transform: skewX(-20deg);
}

@keyframes wo-shimmer-anim {
  0% {
    transform: translateX(-150%) skewX(-20deg);
  }
  100% {
    transform: translateX(250%) skewX(-20deg);
  }
}

.wo-progress-text {
  position: relative;
  width: 100%;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-color, #1e293b);
  mix-blend-mode: multiply;
  line-height: 14px;
  z-index: 1;
  pointer-events: none;
}

[data-theme="dark"] .wo-progress-text {
  color: #ffffff;
  mix-blend-mode: normal;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Equipment Sidebar QR Code, Asset ID & Share Widget
   ───────────────────────────────────────────────────────────────────────────── */
.equipment-sidebar-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 14px;
  background: linear-gradient(180deg, var(--card-bg, #ffffff) 0%, rgba(14, 165, 233, 0.03) 100%);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.equipment-qr-card-header {
  width: 100%;
  margin-bottom: 12px;
}

.equipment-qr-card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--clr-primary, #0ea5e9);
}

.equipment-qr-canvas-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 184px;
  height: 184px;
  padding: 6px;
  background: #ffffff;
  border: 2px dashed rgba(14, 165, 233, 0.35);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 12px;
}

.equipment-qr-canvas-frame:hover {
  transform: scale(1.02);
  border-color: #0ea5e9;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.2);
}

.equipment-qr-canvas-frame canvas,
.equipment-qr-canvas-frame img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.equipment-sidebar-id-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

[data-theme="dark"] .equipment-sidebar-id-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.equipment-sidebar-id-box:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.4);
}

.equipment-id-meta {
  display: flex;
  flex-direction: column;
  text-align: start;
  gap: 1px;
}

.equipment-id-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--task-muted-color, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.equipment-id-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-color, #0f172a);
}

[data-theme="dark"] .equipment-id-value {
  color: #f8fafc;
}

.btn-copy-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--clr-primary, #0ea5e9);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.btn-copy-mini:hover {
  background: rgba(14, 165, 233, 0.15);
}

.equipment-sidebar-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  color: var(--clr-primary, #0ea5e9);
  border: 1px solid rgba(14, 165, 233, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.equipment-sidebar-share-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   AI Assistant Screen & Multi-Device Conversation Drawer
   ───────────────────────────────────────────────────────────────────────────── */
#screen-ai-assistant {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

.ai-app-shell {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--bg-color, #f8fafc);
}

/* Sidebar / Drawer */
.ai-history-pane {
  display: flex;
  flex-direction: column;
  width: 290px;
  min-width: 290px;
  background: var(--card-bg, #ffffff);
  border-inline-end: 1px solid var(--border-color, #e2e8f0);
  height: 100%;
  z-index: 10;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: calc(var(--os-taskbar-h, 60px) + 18px + env(safe-area-inset-bottom, 0px));
}

.ai-history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.ai-btn-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 12px;
}

.ai-history-close-btn {
  display: none;
}

.ai-history-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.ai-history-search-wrap svg {
  position: absolute;
  inset-inline-start: 20px;
  color: var(--task-muted-color, #94a3b8);
  pointer-events: none;
}

.ai-history-search-wrap input {
  width: 100%;
  padding: 6px 10px;
  padding-inline-start: 30px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .ai-history-search-wrap input {
  background: rgba(255, 255, 255, 0.04);
}

.ai-conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.ai-conv-item:hover {
  background: rgba(14, 165, 233, 0.06);
}

.ai-conv-item.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
}

.ai-conv-item__icon {
  color: var(--clr-primary, #0ea5e9);
  flex-shrink: 0;
}

.ai-conv-item__meta {
  flex: 1;
  min-width: 0;
}

.ai-conv-item__title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-color, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-conv-item__time {
  font-size: 0.68rem;
  color: var(--task-muted-color, #64748b);
  margin-top: 2px;
}

.ai-conv-item__del-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--clr-danger, #ef4444);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.ai-conv-item:hover .ai-conv-item__del-btn,
.ai-conv-item.active .ai-conv-item__del-btn {
  display: inline-flex;
}

.ai-conv-item__del-btn:hover {
  background: rgba(239, 68, 68, 0.12);
}

.ai-history-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--task-muted-color, #94a3b8);
  font-size: 0.82rem;
}

/* Main Chat Area */
.ai-main-chat-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.ai-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.ai-welcome-card {
  margin: auto;
  max-width: 620px;
  text-align: center;
  padding: 24px 18px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ai-welcome-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #0ea5e9;
  margin-bottom: 12px;
}

.ai-welcome-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.ai-welcome-card p {
  font-size: 0.84rem;
  color: var(--task-muted-color, #64748b);
  line-height: 1.6;
  margin-bottom: 16px;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ai-chip-prompt {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--text-color, #0f172a);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-chip-prompt:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: #0ea5e9;
  transform: translateY(-1px);
}

/* Chat Messages */
.ai-msg {
  display: flex;
  width: 100%;
}

.ai-msg--user {
  justify-content: flex-end;
}

.ai-msg--assistant {
  justify-content: flex-start;
}

.ai-msg__bubble {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ai-msg--user .ai-msg__bubble {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

[dir="rtl"] .ai-msg--user .ai-msg__bubble {
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 3px;
}

.ai-msg--assistant .ai-msg__bubble {
  background: var(--card-bg, #ffffff);
  color: var(--text-color, #0f172a);
  border: 1px solid var(--border-color, #e2e8f0);
  border-bottom-left-radius: 3px;
}

[dir="rtl"] .ai-msg--assistant .ai-msg__bubble {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 3px;
}

.ai-msg__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .ai-msg__actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.ai-msg__action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.ai-msg__action--ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}

.ai-msg__action--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.ai-msg__action-info {
  display: flex;
  flex-direction: column;
}

.ai-msg__action-info strong {
  font-family: monospace;
  font-size: 0.8rem;
}

/* Confirmation Box inside message */
.ai-msg__confirm-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(14, 165, 233, 0.3);
}

.ai-btn-confirm-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

.ai-btn-confirm-action:hover {
  background: #059669 !important;
}

.ai-btn-cancel-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-confirmed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.ai-cancelled-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.25);
  color: #64748b;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Composer Bar: docked above the floating taskbar icons ── */
.ai-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  background: var(--card-bg, rgba(255, 255, 255, 0.94));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
  z-index: 25;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.04);
  padding-bottom: calc(var(--os-taskbar-h, 60px) + 16px + env(safe-area-inset-bottom, 0px));
}

[data-theme="dark"] .ai-chat-composer {
  background: rgba(30, 41, 59, 0.94);
  border-top-color: rgba(255, 255, 255, 0.1);
}

.ai-chat-composer textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 130px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--input-bg, #ffffff);
  color: var(--text-color, #0f172a);
  font-size: 0.92rem;
  line-height: 1.45;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-composer textarea:focus {
  outline: none;
  border-color: var(--clr-primary, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.ai-chat-composer button {
  height: 42px;
  width: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

#btn-ai-attach-file {
  height: 42px;
  width: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  background: var(--input-bg, #fff);
  color: var(--clr-text-muted, #6b7c8c);
  flex-shrink: 0;
}
#btn-ai-attach-file:hover { color: var(--clr-primary, #0ea5e9); border-color: var(--clr-primary, #0ea5e9); }

.ai-chat-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: var(--card-bg, rgba(14, 165, 233, .08));
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-color, #0f172a);
}
.ai-chat-file-preview svg { flex-shrink: 0; color: var(--clr-primary, #0ea5e9); }
#ai-chat-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btn-ai-file-remove {
  background: none; border: 0; cursor: pointer; color: var(--clr-text-muted, #6b7c8c);
  display: flex; align-items: center; padding: 2px;
}
#btn-ai-file-remove:hover { color: var(--clr-danger, #dc453f); }

.ai-msg__attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-text-muted, #6b7c8c);
  margin-bottom: 6px;
}

.ai-msg__download {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--clr-primary, #0ea5e9);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}
.ai-msg__download:hover { background: rgba(14, 165, 233, .08); }
.ai-msg__download svg { flex-shrink: 0; color: var(--clr-primary, #0ea5e9); }
.ai-msg__download strong { display: block; font-size: 13px; }
.ai-msg__download small { color: var(--clr-text-muted, #6b7c8c); font-size: 11.5px; }

/* Mobile Drawer */
@media (max-width: 768px) {
  .ai-history-pane {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    transform: translateX(-100%);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
  }

  [dir="rtl"] .ai-history-pane {
    transform: translateX(100%);
  }

  .ai-history-pane.open {
    transform: translateX(0);
  }

  .ai-history-close-btn {
    display: inline-flex;
  }

  .ai-history-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9;
  }

  .ai-history-backdrop.open {
    display: block;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Windows 11 Fluent Project Folder Cards
   ───────────────────────────────────────────────────────────────────────────── */
#projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 8px 0 32px;
}

@media (max-width: 640px) {
  #projects-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.os-folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 16px 18px;
  padding-top: 14px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-sizing: border-box;
}

[data-theme="dark"] .os-folder-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.os-folder-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.16), 0 4px 10px rgba(0, 0, 0, 0.05);
  border-color: rgba(245, 158, 11, 0.5);
}

/* Folder Top Tab Notch */
.os-folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 18px;
  width: 80px;
  height: 5px;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 0 0 5px 5px;
  transition: width 0.25s ease;
}

.os-folder-card:hover::before {
  width: 120px;
}

/* Folder Top Bar */
.folder-tab-lip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.folder-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.folder-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(251, 191, 36, 0.28) 100%);
  color: #d97706;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .folder-icon-wrap {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.folder-id-tag {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--task-muted-color, #64748b);
  letter-spacing: 0.3px;
}

/* Project Title & Description */
.folder-card-header {
  margin-bottom: 12px;
}

.folder-project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.folder-project-desc {
  font-size: 0.8rem;
  color: var(--task-muted-color, #64748b);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Inside Quick Stats Grid */
.folder-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.folder-stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.85);
  transition: background 0.15s ease;
}

[data-theme="dark"] .folder-stat-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

.folder-stat-chip--eq .stat-chip-icon {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.12);
}

.folder-stat-chip--tasks .stat-chip-icon {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
}

.stat-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}

.stat-chip-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-chip-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--task-muted-color, #64748b);
  white-space: nowrap;
}

.stat-chip-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  white-space: nowrap;
}

/* Timeline & Percentage */
.folder-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.75rem;
  color: var(--task-muted-color, #64748b);
}

.folder-timeline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--task-muted-color, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-progress-badge {
  font-weight: 700;
  font-size: 0.8rem;
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.folder-progress-badge.done {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Progress Track & Fill with Shimmer Animation */
.folder-progress-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(226, 232, 240, 0.85);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

[data-theme="dark"] .folder-progress-track {
  background: rgba(255, 255, 255, 0.1);
}

.folder-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
  position: relative;
}

.folder-progress-fill.done {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Routine Checklists (High-Volume Optimization, Sticky Controls, Search & A4)
   ───────────────────────────────────────────────────────────────────────────── */
#screen-daily-checklist-templates {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
#screen-daily-checklist-templates::-webkit-scrollbar,
.dc-scrollable-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#screen-daily-checklist-templates::-webkit-scrollbar-track,
.dc-scrollable-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
}
#screen-daily-checklist-templates::-webkit-scrollbar-thumb,
.dc-scrollable-container::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.25);
  border-radius: 8px;
}
#screen-daily-checklist-templates::-webkit-scrollbar-thumb:hover,
.dc-scrollable-container::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.5);
}

/* Sticky Header */
#screen-daily-checklist-templates .dc-sticky-header {
  position: sticky;
  top: 0;
  z-index: 35;
  background: var(--card-bg, #ffffff);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

/* Sticky Controls Bar */
.dc-controls-sticky-bar {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: var(--card-bg, rgba(255, 255, 255, 0.96));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 10px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .dc-controls-sticky-bar {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

.dc-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Live Search Box */
.dc-search-box {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
  display: flex;
  align-items: center;
}

.dc-search-icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--task-muted-color, #94a3b8);
  pointer-events: none;
}

.dc-search-box input[type="search"] {
  width: 100%;
  padding: 8px 32px 8px 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface, #ffffff);
  color: var(--text-color, #0f172a);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.18s ease;
}

[dir="rtl"] .dc-search-box input[type="search"] {
  padding: 8px 36px 8px 32px;
}

.dc-search-box input[type="search"]:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.dc-search-clear {
  position: absolute;
  inset-inline-end: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

/* Filter Group */
.dc-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dc-select-filter {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--surface, #ffffff);
  color: var(--text-color, #1e293b);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.dc-select-filter:focus {
  border-color: #0ea5e9;
}

/* Counter Strip */
.dc-stats-counter-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(226, 232, 240, 0.8);
  font-size: 0.78rem;
  flex-wrap: wrap;
}

[data-theme="dark"] .dc-stats-counter-strip {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dc-counter-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.8);
  font-weight: 600;
  color: var(--text-color, #334155);
}

[data-theme="dark"] .dc-counter-item {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.dc-counter-item--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.dc-counter-item--pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.dc-counter-num {
  font-weight: 700;
}

.dc-counter-showing {
  margin-inline-start: auto;
  color: var(--task-muted-color, #64748b);
  font-size: 0.76rem;
}

/* Pagination Bar */
.dc-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  margin: 12px 0 24px;
  flex-wrap: wrap;
}

.dc-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--card-bg, #ffffff);
  color: var(--text-color, #334155);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dc-page-btn:hover:not(:disabled) {
  border-color: #0ea5e9;
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.06);
}

.dc-page-btn.active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.dc-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Floating Interactive Scroll Navigation Widget */
.dc-floating-scroll-nav {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card-bg, rgba(255, 255, 255, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.9));
  border-radius: 24px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  z-index: 99;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .dc-floating-scroll-nav {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dc-scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dc-scroll-btn:hover {
  background: #0ea5e9;
  color: #ffffff;
  transform: scale(1.08);
}

.dc-scroll-indicator {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--task-muted-color, #64748b);
  padding: 2px 0;
  user-select: none;
}

/* Completed Highlight on Template Card */
.dc-routine-template-card.is-completed {
  border-inline-start: 4px solid #10b981;
}

.dc-completed-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   A4 Print / PDF Template Engine Styling
   ───────────────────────────────────────────────────────────────────────────── */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm 12mm 10mm;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   QR Stickers & Barcode Print/Preview Action Buttons Polish
   ───────────────────────────────────────────────────────────────────────────── */
.btn-preview-styled,
.btn-print-styled {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-height: 40px !important;
  box-sizing: border-box !important;
}

.btn-preview-styled {
  background: var(--surface, #ffffff) !important;
  color: var(--text-color, #1e293b) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="dark"] .btn-preview-styled {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.btn-preview-styled:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: #0ea5e9 !important;
  color: #0ea5e9 !important;
  transform: translateY(-1px);
}

.btn-print-styled {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #059669 !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3) !important;
}

.btn-print-styled:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px);
}

.btn-preview-styled:disabled,
.btn-print-styled:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.2) !important;
}

/* Ensure container actions layout is aligned */
.print-actions,
.eqs-action-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Thermal Label Preview Cards & Brand Header / Print Date Styling
   ───────────────────────────────────────────────────────────────────────────── */
.eqs-preview-card,
.bc-preview-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #ffffff !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
  color: #0f172a !important;
  min-height: 160px !important;
  box-sizing: border-box !important;
  gap: 8px !important;
}

[data-theme="dark"] .eqs-preview-card,
[data-theme="dark"] .bc-preview-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

.eqs-prev-brand,
.bc-label-brand {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding-bottom: 6px !important;
  border-bottom: 1.5px solid var(--border-color, #e2e8f0) !important;
  width: 100% !important;
}

.eqs-prev-logo,
.bc-brand-logo {
  width: 22px !important;
  height: 22px !important;
  object-fit: contain !important;
  border-radius: 4px !important;
}

.eqs-prev-company,
.bc-brand-name {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .eqs-prev-company,
[data-theme="dark"] .bc-brand-name {
  color: #f8fafc !important;
}

.eqs-prev-body {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  flex: 1 !important;
}

.eqs-prev-info,
.bc-preview-info {
  display: flex !important;
  flex-direction: column !important;
  text-align: right !important;
  min-width: 0 !important;
  flex: 1 !important;
  gap: 2px !important;
}

.eqs-prev-name,
.bc-preview-title {
  font-size: 0.85rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  line-height: 1.3 !important;
}

[data-theme="dark"] .eqs-prev-name,
[data-theme="dark"] .bc-preview-title {
  color: #f8fafc !important;
}

.eqs-prev-code,
.bc-preview-code {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
}

.eqs-prev-sub,
.bc-preview-id {
  font-size: 0.72rem !important;
  color: #64748b !important;
}

.eqs-prev-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding-top: 6px !important;
  border-top: 1px dashed var(--border-color, #e2e8f0) !important;
}

.eqs-prev-print-date,
.bc-label-print-date {
  font-size: 0.68rem !important;
  font-family: monospace !important;
  color: #64748b !important;
  font-weight: 600 !important;
}

.eqs-prev-hint {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  color: #0284c7 !important;
  letter-spacing: 0.03em !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Warehouse Project Cards (Windows Folder Envelope Design & Mobile Responsive)
   ───────────────────────────────────────────────────────────────────────────── */
#screen-warehouse #wh-projects-list,
#screen-warehouse .wh-project-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)) !important;
  gap: 16px !important;
  padding-bottom: 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#screen-warehouse .wh-project-card.os-folder-envelope {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: var(--surface, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  gap: 12px !important;
  overflow: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] #screen-warehouse .wh-project-card.os-folder-envelope {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

#screen-warehouse .wh-project-card.os-folder-envelope:hover {
  transform: translateY(-2px) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.12) !important;
}

.wh-project-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
}

.wh-project-tab-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1.5px dashed var(--border-color, #e2e8f0) !important;
  padding-bottom: 8px !important;
  gap: 8px !important;
  width: 100% !important;
}

.wh-project-folder-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #f59e0b !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  flex-shrink: 0 !important;
}

.wh-project-badge-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.wh-code-badge {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  font-family: monospace !important;
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.08) !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

.wh-status-badge {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

.wh-status-badge.is-active {
  color: #059669 !important;
  background: rgba(16, 185, 129, 0.12) !important;
}

.wh-status-badge.is-done {
  color: #64748b !important;
  background: rgba(100, 116, 139, 0.12) !important;
}

.wh-project-header-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.wh-project-icon-box {
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  flex-shrink: 0 !important;
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
}

.wh-project-icon-box.danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.wh-project-icon-box.warn {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
}

.wh-project-icon-box.success {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
}

.wh-health-dot {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  border: 2px solid var(--surface, #ffffff) !important;
}

.wh-health-dot--success { background: #10b981 !important; }
.wh-health-dot--warn { background: #f59e0b !important; }
.wh-health-dot--danger { background: #ef4444 !important; }

.wh-project-title-box {
  flex: 1 !important;
  min-width: 0 !important;
}

.wh-project-name {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  line-height: 1.3 !important;
  margin: 0 0 2px 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .wh-project-name {
  color: #f8fafc !important;
}

.wh-project-sub {
  font-size: 0.72rem !important;
  color: #64748b !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.wh-project-quick-actions {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

/* Stats Grid */
.wh-project-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  background: var(--surface-soft, #f8fafc) !important;
  padding: 8px 6px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .wh-project-stats-grid {
  background: #0f172a !important;
  border-color: #334155 !important;
}

.wh-stat-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 2px !important;
  padding: 4px 2px !important;
}

.wh-stat-num {
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  line-height: 1 !important;
}

[data-theme="dark"] .wh-stat-num {
  color: #f8fafc !important;
}

.wh-stat-box.stat-healthy .wh-stat-num { color: #10b981 !important; }
.wh-stat-box.stat-low .wh-stat-num { color: #f59e0b !important; }
.wh-stat-box.stat-out .wh-stat-num { color: #ef4444 !important; }

.wh-stat-lbl {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  white-space: nowrap !important;
}

/* Multi-color stock progress track */
.wh-stock-track {
  display: flex !important;
  height: 6px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: rgba(100, 116, 139, 0.15) !important;
  width: 100% !important;
}

.wh-stock-fill-healthy { background: #10b981 !important; transition: width 0.3s ease; }
.wh-stock-fill-low { background: #f59e0b !important; transition: width 0.3s ease; }
.wh-stock-fill-out { background: #ef4444 !important; transition: width 0.3s ease; }

.wh-project-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 100% !important;
}

.wh-project-view-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Warehouse Item Cards (Product Card Design & Clean Mobile Layout)
   ───────────────────────────────────────────────────────────────────────────── */
#screen-warehouse #wh-items-list,
#screen-warehouse .wh-items-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.wh-item-card-enhanced {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: var(--surface, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .wh-item-card-enhanced {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.wh-item-card-enhanced:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.1) !important;
  transform: translateY(-2px);
}

.wh-item-header {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
}

.wh-item-thumb-wrapper {
  flex-shrink: 0 !important;
}

.wh-item-thumb {
  width: 48px !important;
  height: 48px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
}

.wh-item-icon-placeholder {
  width: 48px !important;
  height: 48px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(2, 132, 199, 0.08) !important;
  color: #0284c7 !important;
}

.wh-item-icon-placeholder.tool { background: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.wh-item-icon-placeholder.equipment { background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }

.wh-item-main-info {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.wh-item-top-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
}

.wh-item-id-badge {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  font-family: monospace !important;
  color: #64748b !important;
  background: rgba(100, 116, 139, 0.1) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
}

.wh-item-type-chip {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
}

.wh-item-stock-chip {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
}

.wh-item-stock-chip.stock-ok {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}

.wh-item-stock-chip.stock-low {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}

.wh-item-stock-chip.stock-out {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}

.wh-item-title {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

[data-theme="dark"] .wh-item-title {
  color: #f8fafc !important;
}

.wh-item-body-grid {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--surface-soft, #f8fafc) !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .wh-item-body-grid {
  background: #0f172a !important;
  border-color: #334155 !important;
}

.wh-item-qty-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  min-width: 60px !important;
  flex-shrink: 0 !important;
}

.wh-item-qty-box.qty-ok {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #059669 !important;
}

.wh-item-qty-box.qty-low {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}

.wh-item-qty-box.qty-out {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}

.wh-qty-value {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

.wh-qty-unit {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
}

.wh-item-details-box {
  flex: 1 !important;
  min-width: 0 !important;
}

.wh-item-description {
  font-size: 0.74rem !important;
  color: #475569 !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

[data-theme="dark"] .wh-item-description {
  color: #94a3b8 !important;
}

.wh-item-no-desc {
  font-size: 0.7rem !important;
  color: #94a3b8 !important;
  font-style: italic !important;
}

.wh-item-actions-bar {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding-top: 6px !important;
  border-top: 1px dashed var(--border-color, #e2e8f0) !important;
  width: 100% !important;
}

.btn-wh-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  background: var(--surface, #ffffff) !important;
  color: var(--task-title-color, #334155) !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  flex: 1 !important;
  min-height: 30px !important;
  white-space: nowrap !important;
}

[data-theme="dark"] .btn-wh-action {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

.btn-wh-action:hover {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

.btn-wh-action.btn-wh-trx {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.btn-wh-action.btn-wh-trx:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

.btn-wh-action.btn-wh-del {
  flex: 0 0 28px !important;
  padding: 5px 0 !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.btn-wh-action.btn-wh-del:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Responsiveness for Screen Warehouse (< 640px)
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #screen-warehouse #wh-projects-list,
  #screen-warehouse .wh-project-list,
  #screen-warehouse #wh-items-list,
  #screen-warehouse .wh-items-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .wh-project-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 10px 8px !important;
  }

  .wh-stat-box {
    padding: 6px 4px !important;
    background: var(--surface, #ffffff) !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
  }

  [data-theme="dark"] .wh-stat-box {
    background: #1e293b !important;
    border-color: #334155 !important;
  }

  .wh-item-actions-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr auto !important;
    gap: 4px !important;
  }

  .btn-wh-action.btn-wh-del {
    grid-column: 3 !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Equipment Cards (Concise Details & Mobile Responsive Design)
   ───────────────────────────────────────────────────────────────────────────── */
#milestones-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pg-list-row.eq-card-enhanced {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: var(--surface, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .pg-list-row.eq-card-enhanced {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.pg-list-row.eq-card-enhanced:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.12) !important;
  transform: translateY(-2px);
}

.eq-card-top-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  border-bottom: 1.5px dashed var(--border-color, #e2e8f0) !important;
  padding-bottom: 8px !important;
  width: 100% !important;
}

.eq-card-left-badges,
.eq-card-right-badges {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
}

.eq-code-badge {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  font-family: monospace !important;
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.08) !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

.eq-category-badge {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  background: var(--surface-soft, #f1f5f9) !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

[data-theme="dark"] .eq-category-badge {
  background: #0f172a !important;
  color: #94a3b8 !important;
}

.eq-project-badge {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
}

[data-theme="dark"] .eq-project-badge {
  color: #94a3b8 !important;
}

.eq-crit-badge {
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  padding: 2px 6px !important;
  border-radius: 5px !important;
  text-transform: uppercase !important;
}

.eq-crit-badge.crit-critical {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}

.eq-crit-badge.crit-high {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}

.eq-crit-badge.crit-medium,
.eq-crit-badge.crit-low {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
}

.eq-status-badge {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
}

.eq-status-badge.is-complete {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}

.eq-status-badge.is-pending {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}

.eq-card-main-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.eq-icon-box {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.eq-icon-box.is-done {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
}

.eq-icon-box.is-pending {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
}

.eq-card-title-box {
  flex: 1 !important;
  min-width: 0 !important;
}

.eq-card-title {
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  margin: 0 0 3px 0 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .eq-card-title {
  color: #f8fafc !important;
}

.eq-card-sub-line {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.74rem !important;
  color: #64748b !important;
  flex-wrap: wrap !important;
}

.eq-sub-spec {
  font-weight: 600 !important;
  color: #475569 !important;
}

[data-theme="dark"] .eq-sub-spec {
  color: #94a3b8 !important;
}

.eq-sub-loc {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

/* Stats Grid */
.eq-card-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  background: var(--surface-soft, #f8fafc) !important;
  padding: 8px 6px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .eq-card-stats-grid {
  background: #0f172a !important;
  border-color: #334155 !important;
}

.eq-stat-pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 2px !important;
  padding: 3px 2px !important;
}

.eq-stat-val {
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  color: var(--task-title-color, #0f172a) !important;
  line-height: 1 !important;
}

[data-theme="dark"] .eq-stat-val {
  color: #f8fafc !important;
}

.eq-stat-pill.stat-done .eq-stat-val { color: #10b981 !important; }
.eq-stat-pill.stat-pending .eq-stat-val { color: #f59e0b !important; }

.eq-stat-val-sm {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  font-family: monospace !important;
  color: #0284c7 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.eq-stat-lbl {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  white-space: nowrap !important;
}

/* Progress Row */
.eq-progress-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.eq-progress-track {
  flex: 1 !important;
  height: 5px !important;
  border-radius: 999px !important;
  background: rgba(100, 116, 139, 0.15) !important;
  overflow: hidden !important;
}

.eq-progress-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #0ea5e9, #10b981) !important;
  border-radius: 999px !important;
  transition: width 0.3s ease !important;
}

.eq-progress-pct {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  font-family: monospace !important;
  color: #0284c7 !important;
}

@media (max-width: 640px) {
  #milestones-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .eq-card-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 10px 8px !important;
  }

  .eq-stat-pill {
    padding: 6px 4px !important;
    background: var(--surface, #ffffff) !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
  }

  [data-theme="dark"] .eq-stat-pill {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
}









