/* ==========================================================================
   Settings: classifications, equipment categories, fields, statuses
   ========================================================================== */

/* ---------------------------- site classification tree ---------------------------- */
.class-tree { display: grid; gap: 10px; }
.tree-card { overflow: hidden; }
.tree-card__summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; }
.tree-card__summary::-webkit-details-marker { display: none; }
.tree-card__summary:hover { background: var(--surface-2); }
.tree-card__title { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.tree-card__title strong { font-size: 1rem; }
.tree-card__title small { color: var(--text-3); font-size: 12.5px; }
.tree-card__chevron { color: var(--text-3); transition: transform .2s; }
details[open] > .tree-card__summary .tree-card__chevron { transform: rotate(180deg); }
details[open] > .tree-card__summary { border-bottom: 1px solid var(--line); }
.tree-card__body { display: grid; gap: 2px; padding: 8px 12px 12px; }
.tree-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 12px 6px 0; border-top: 1px dashed var(--line); }
.tree-card__footer form { margin: 0; }

.tree-node { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border-radius: 10px; }
.tree-node:hover { background: var(--surface-2); }
.tree-node__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.tree-node--subtype .tree-node__dot { background: transparent; border: 1.5px solid var(--text-3); width: 8px; height: 8px; }
.tree-node__main { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.tree-node__name { font-weight: 600; }
.tree-node--subtype .tree-node__name { font-weight: 500; }
.tree-node .row-actions { opacity: .55; transition: opacity .15s; }
.tree-node:hover .row-actions, .tree-node:focus-within .row-actions { opacity: 1; }
.tree-node.is-inactive .tree-node__name { color: var(--text-3); }
.tree-children { margin: 0 0 4px 17px; padding-left: 14px; border-left: 2px solid var(--line); display: grid; gap: 1px; }
@media (hover: none) { .tree-node .row-actions { opacity: 1; } }

/* icon picker */
.icon-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; padding: 4px; }
.icon-option { position: relative; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-option span { display: grid; place-items: center; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: all .15s; }
.icon-option span .icon { width: 20px; height: 20px; }
.icon-option:hover span { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.icon-option input:checked + span { background: var(--surface-3); border-color: var(--text); color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.icon-option input:focus-visible + span { box-shadow: var(--focus); }

/* ----------------------------- equipment categories ----------------------------- */
/* systems as cards; the whole card opens the system (stretched link), the reorder buttons stay clickable */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.category-card { position: relative; display: grid; grid-template-rows: 1fr auto; transition: border-color .15s; }
.category-card:hover { border-color: var(--line-strong); }
.category-card.is-inactive { opacity: .7; }
.category-card__link { display: grid; gap: 6px; align-content: start; padding: 18px 18px 14px; color: var(--text); }
.category-card__link:hover { text-decoration: none; color: var(--text); }
.category-card__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.category-card__link:focus-visible { box-shadow: none; }
.category-card__link:focus-visible::after { box-shadow: var(--focus); }
.category-card__icon {
  width: 44px; height: 44px; margin-bottom: 6px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.category-card__icon .icon { width: 22px; height: 22px; }
.category-card__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.category-card__text { color: var(--text-2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-card__footer {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
  padding: 6px 10px 6px 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; pointer-events: none;
}
.category-card__footer .row-actions { pointer-events: auto; }

.system-card .card__header { align-items: center; }
.system-card .entity__thumb { width: 40px; height: 40px; }
.system-card .card__heading h2 a { color: var(--text); }
.system-card .card__heading h2 a:hover { color: var(--text); text-decoration: underline; }
.table--fixed { table-layout: fixed; }
.table--fixed .col-prefix { width: 150px; }
.table--fixed .col-count { width: 140px; }
.table--fixed .col-wide-actions { width: 150px; }
@media (max-width: 720px) { .table--fixed { table-layout: auto; } }

/* ----------------------------------- fields ----------------------------------- */
.options-editor { display: grid; gap: 8px; justify-items: start; }
.options-editor__list { display: grid; gap: 6px; width: 100%; }
.options-editor__row { display: flex; align-items: center; gap: 8px; }
.options-editor__row .input { flex: 1; }

/* ---------------------------------- statuses ---------------------------------- */
.status-preview-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line-strong); }
.tone-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.tone-picker__options { display: flex; flex-wrap: wrap; gap: 8px; }
.tone-option { position: relative; cursor: pointer; padding: 4px; border-radius: 999px; border: 2px solid transparent; transition: border-color .15s; }
.tone-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tone-option:hover { border-color: var(--line-strong); }
.tone-option:has(input:checked) { border-color: var(--text); }
.tone-option:has(input:focus-visible) { box-shadow: var(--focus); }
