/* ==========================================================================
   Work order templates: the cards of "Nova ordem de trabalho" (step one of a manual order) and the list in the
   settings area.
   ========================================================================== */
.template-picker { display: grid; gap: 16px; padding: 18px; min-width: 0; }
.template-picker__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.template-picker__heading { margin: 0; font-size: 15px; font-weight: 600; }
.template-picker__context { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-2); font-size: 13.5px; min-width: 0; flex: 1 1 200px; }
.template-picker__context .icon { color: var(--text-3); flex: none; }
.template-picker__search { flex: 0 1 320px; min-width: 0; margin-left: auto; }
.template-picker__none { margin: 0; text-align: center; padding: 12px 0; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.template-card {
  display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; min-width: 0;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.template-card:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.template-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.template-card > * { min-width: 0; }
.template-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.template-card__icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.template-card__icon .icon { width: 20px; height: 20px; }
.template-card__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.template-card__title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
.template-card__asset, .template-card__loc { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-2); }
.template-card__asset .icon, .template-card__loc .icon { flex: none; color: var(--text-3); }
.template-card__asset .truncate, .template-card__loc .truncate { min-width: 0; flex: 1 1 auto; }
.template-card__asset--any { color: var(--text-3); }
.template-card__loc { font-size: 12.5px; color: var(--text-3); }
.template-card__meta { font-size: 12.5px; color: var(--text-3); }
.template-card--blank { border-style: dashed; background: transparent; }
.template-card--blank .template-card__icon { background: var(--surface); }

/* the form opened from a template */
.template-origin { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 20px; }
.template-origin__text { flex: 1 1 240px; min-width: 0; }

/* settings list: the type, priority and state sit under the title; long asset names are cut */
.template-table__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.template-table__asset > div { max-width: 200px; }
.template-table td:first-child .entity__sub { white-space: normal; }
.template-table td:first-child .entity__name { display: block; }
