/* Les sélecteurs de thème sont limités à la racine ; les boutons de choix ne changent pas les variables. */
.material-visual {
  height: 185px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.material-visual img {
  display: block;
  flex: 0 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  box-sizing: border-box;
}
.equipment-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 43px 16px 10px;
}
.equipment-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.choice-card[data-action="set-theme"][data-theme="dark"] {
  background: #1d2129;
  color: #f0f1f4;
  border-color: #505765;
}
.choice-card[data-action="set-theme"][data-theme="dark"] > .icon {
  color: #bac3d2;
}
.choice-card[data-action="set-theme"][data-theme="light"] {
  background: #fff;
  color: #242934;
}
.choice-card[data-action="set-theme"].active {
  outline: 2px solid var(--active-text);
  outline-offset: 2px;
}
.template-grid p,
.model-source,
.template-row small {
  font-size: 12px;
  line-height: 1.6;
}
.template-grid .panel {
  display: flex;
  flex-direction: column;
}
.template-grid .stack {
  margin-top: auto;
  padding-top: 18px;
}
.template-grid h3 {
  line-height: 1.5;
}
.pos-reference > summary {
  cursor: pointer;
  font-size: 13px;
}
.pos-reference td {
  white-space: normal;
  min-width: 85px;
}
.pos-reference td:first-child {
  min-width: 200px;
}
.pos-reference td:last-child {
  min-width: 220px;
}
.template-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 150px 36px;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.template-row .input {
  font-size: 13px;
  min-width: 0;
}
.template-row .stack {
  gap: 9px;
}
.template-row summary {
  font-size: 11px;
  color: var(--muted);
}
.template-row details p {
  font-size: 11px;
  margin-top: 8px;
}
.model-source {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.take-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.take-entry > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.take-entry > div > .icon {
  width: 29px;
  height: 29px;
  color: var(--green);
}
.take-entry h2 {
  font-size: 18px;
}
.take-entry p {
  font-size: 12px;
  margin-top: 7px;
}
.step-caption {
  font-size: 13px;
  font-weight: 650;
  color: var(--blue);
}
.take-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.take-row[hidden] {
  display: none;
}
.take-row > div:first-child {
  min-width: 0;
}
.take-row h3 {
  font-size: 14px;
  line-height: 1.5;
}
.take-row p {
  font-size: 12px;
  margin-top: 6px;
}
.take-quantity {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  flex-shrink: 0;
  overflow: hidden;
}
.take-quantity button {
  border: 0;
  background: var(--surface2);
  color: var(--text);
  width: 40px;
  min-height: 45px;
  font-size: 22px;
}
.take-quantity input {
  background: var(--surface);
  color: var(--text);
  border: 0;
  width: 48px;
  min-height: 45px;
  text-align: center;
  font-size: 16px;
  appearance: textfield;
}
.take-quantity input::-webkit-inner-spin-button {
  appearance: none;
}
.take-batches {
  font-size: 11px;
  margin-top: 9px;
}
.take-batches summary {
  cursor: pointer;
  color: var(--muted);
}
.take-batches .checkbox-label {
  font-size: 12px;
}
.vehicle-photo-preview {
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 16px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.vehicle-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.account-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}
.account-summary > .avatar {
  width: 45px;
  height: 45px;
  font-size: 14px;
}
.account-summary p {
  font-size: 12px;
  margin-top: 6px;
}
.appearance-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.appearance-options .selection-card {
  flex-wrap: wrap;
}
.appearance-options .icon {
  width: 19px;
  height: 19px;
}
.preference-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 130px;
  align-items: center;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.notification-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.notification-rule p {
  font-size: 12px;
  line-height: 1.7;
}
.recipient-options {
  margin-top: 10px;
  display: grid;
  gap: 3px;
}
.recipient-options .checkbox-label {
  font-size: 12px;
}
.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  background: var(--red);
  border-radius: 50%;
  pointer-events: none;
}
.topbar .icon-btn.notification-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  min-width: 44px;
  min-height: 44px;
}
.topbar [data-action="notifications"] {
  position: relative;
}
.notification-item.unread {
  border-left: 3px solid var(--red);
  padding-left: 14px;
}
.danger {
  color: var(--red);
}
.modal-footer {
  flex-wrap: wrap;
}
.template-row .checkbox-label {
  font-size: 12px;
}
.notification-rule h3 {
  line-height: 1.5;
}
.notification-rule h4 {
  font-size: 12px;
}
@media (max-width: 1000px) {
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notification-rules {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .material-visual {
    height: 145px;
  }
  .material-visual img {
    padding: 8px;
  }
  .equipment-photo {
    padding: 36px 12px 8px;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
  .template-row {
    grid-template-columns: 1fr 95px;
    gap: 14px;
  }
  .template-row > .stack:first-child {
    grid-column: 1/-1;
  }
  .template-row > .stack {
    grid-column: 1;
  }
  .template-row > .label {
    grid-column: 2;
    grid-row: 2;
  }
  .template-row > .icon-btn {
    grid-column: 2;
    justify-self: end;
    grid-row: 3;
  }
  .template-row .input {
    font-size: 15px;
  }
  .take-entry {
    display: block;
  }
  .take-entry > .btn {
    width: 100%;
    margin-top: 16px;
  }
  .take-entry h2 {
    font-size: 16px;
  }
  .take-row {
    align-items: flex-start;
    gap: 12px;
  }
  .take-row h3 {
    font-size: 13px;
  }
  .take-quantity button {
    width: 32px;
    min-height: 43px;
  }
  .take-quantity input {
    width: 37px;
    min-height: 43px;
  }
  .take-batches .checkbox-label {
    font-size: 11px;
  }
  .appearance-options {
    grid-template-columns: 1fr;
  }
  .preference-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .preference-row > strong {
    grid-column: 1/-1;
  }
  .notification-rules {
    grid-template-columns: 1fr;
  }
  .notification-rule .row.between {
    align-items: flex-start;
  }
  .notification-rule > .row > .checkbox-label {
    flex-shrink: 0;
  }
  .model-source {
    font-size: 12px;
  }
  .modal-footer .btn {
    font-size: 12px;
  }
  .template-grid .panel h3 {
    font-size: 15px;
  }
}
html .btn.text-btn:where(:not(.secondary):not(.soft):not(.green)) {
  background: transparent;
  color: var(--muted);
  border: 0;
  box-shadow: none;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 550;
}
.material-undo {
  margin-bottom: 20px;
  align-items: center;
  gap: 12px;
}
.material-undo > span {
  flex: 1;
}
.material-undo .icon-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.material-undo .text-btn {
  font-weight: 650;
  min-height: 38px;
}
.material-undo .icon {
  margin: 0;
}
.template-grid .btn.soft {
  white-space: normal;
}
html .btn.text-btn.danger {
  min-height: 45px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 650;
  gap: 8px;
}
.btn.danger .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.unit-label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.unit-label .unit-input {
  color: var(--text);
  font-weight: 400;
}
.stock-menu-anchor {
  position: relative;
}
.stock-more {
  font-size: 24px;
  line-height: 1;
  letter-spacing: 1px;
}
.stock-action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 30;
  min-width: 195px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px #0002;
  border-radius: 12px;
  padding: 6px;
}
.stock-action-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 12px;
}
.stock-action-menu button.danger {
  color: var(--red);
}
.stock-action-menu button:hover {
  background: var(--surface2);
}
.stock-action-menu .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .unit-label {
    font-size: 12px;
  }
  .stock-row {
    display: block;
    padding: 20px 0;
  }
  .stock-row > div:first-child {
    width: 100%;
    margin-bottom: 14px;
  }
  .stock-row > div:first-child strong {
    font-size: 14px;
    line-height: 1.5;
  }
  .stock-row > div:first-child small {
    font-size: 12px;
    line-height: 1.6;
  }
  .stock-row > .row {
    justify-content: flex-end;
    gap: 10px;
  }
  .stock-row > .row > .btn {
    width: auto;
    min-height: 42px;
    font-size: 13px;
    padding: 10px 17px;
    margin: 0;
  }
  .stock-row .stock-more {
    width: 42px;
    height: 42px;
  }
  .stock-action-menu {
    min-width: 195px;
  }
  .stock-action-menu button {
    font-size: 13px;
  }
  .stock-menu-anchor {
    flex: 0 0 auto !important;
  }
}
.stock-action-menu.opens-up {
  top: auto;
  bottom: calc(100% + 7px);
}
