/* ==========================================================================
   Admin Departments list + detail.
   Owning feature: admin departments
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* Admin Departments — compact list + detail */
.fh-dept-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: var(--fh-read-max);
  width: 100%;
  margin-inline: auto;
}
.fh-dept-page .fh-content-head-main {
  gap: 0.75rem;
}

/* KPI Overview Stats Strip */
.fh-dept-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-md, 8px);
}
.fh-dept-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fh-dept-stat-label {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
  text-transform: uppercase;
  letter-spacing: var(--fh-tracking-wide);
  font-weight: var(--fh-weight-semibold);
}
.fh-dept-stat-value {
  font-size: var(--fh-text-lg);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  line-height: var(--fh-leading-tight);
}

/* Toolbar & Search */
.fh-dept-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.fh-dept-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-sm, 6px);
  padding: 0 0.65rem;
  min-width: 14rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.fh-dept-search:focus-within {
  background: #fff;
  border-color: var(--fh-primary);
  box-shadow: 0 0 0 1px var(--fh-primary);
}
.fh-dept-search i { color: var(--fh-muted); font-size: var(--fh-text-sm); }
.fh-dept-search .form-control {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
}

/* Table elements */
.fh-dept-name {
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  text-decoration: none;
}
.fh-dept-name:hover {
  text-decoration: underline;
  color: var(--fh-primary);
}
.fh-dept-code,
.fh-dept-meta {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}
.fh-dept-code-chip {
  font-size: 0.75rem;
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-muted);
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-sm, 4px);
  padding: 0.1rem 0.45rem;
  font-family: var(--fh-font-mono, monospace);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.fh-dept-empty-chair {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
  background: var(--fh-soft);
  border: 1px dashed var(--fh-border);
  border-radius: var(--fh-radius-sm, 4px);
  padding: 0.2rem 0.5rem;
}
.fh-dept-empty-chair i { font-size: 0.85em; }

.fh-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  color: var(--fh-muted);
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fh-dept-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
.fh-dept-row-actions form { margin: 0; }
.fh-dept-row-actions a.fh-icon-btn { text-decoration: none; color: inherit; }
.fh-dept-row-actions .fh-icon-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.fh-dept-meter { min-width: 10rem; max-width: 16rem; }
.fh-storage-bar-compact {
  height: 0.4rem;
  border-radius: 999px;
}
.fh-storage-bar-caption {
  font-size: var(--fh-text-xs);
  margin-top: 0.25rem;
  line-height: var(--fh-leading-tight);
}

.fh-dept-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.fh-dept-sort:hover { color: var(--fh-text); }
.fh-dept-sort.is-sorted { color: var(--fh-text); font-weight: var(--fh-weight-semibold); }

/* Navigation Tabs in Edit */
.fh-dept-tabs {
  border-bottom: 1px solid var(--fh-border);
  margin-bottom: 0.25rem;
}
.fh-dept-tabs .nav-link {
  font-size: var(--fh-text-base);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.65rem 1rem;
  transition: color 0.15s, border-color 0.15s;
}
.fh-dept-tabs .nav-link:hover {
  color: var(--fh-text);
  border-bottom-color: var(--fh-border);
}
.fh-dept-tabs .nav-link.active {
  color: var(--fh-primary);
  border-bottom-color: var(--fh-primary);
  background: transparent;
}

/* Cards & Forms */
.fh-dept-card {
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-md, 8px);
  background: #fff;
  box-shadow: var(--fh-shadow-sm);
}
.fh-dept-card .card-header {
  background: #fff;
  border-bottom: 1px solid var(--fh-border);
  padding: 0.85rem 1.15rem;
}
.fh-dept-card .card-body {
  padding: 1.15rem;
}

.fh-dept-form { max-width: 26rem; }
.fh-dept-inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 28rem;
}
.fh-dept-inline-form .form-select { flex: 1; min-width: 0; }

@media (max-width: 767.98px) {
  .fh-dept-search {
    flex: 1 1 100%;
    min-width: 0;
  }
  .fh-dept-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .fh-dept-toolbar .fh-toolbar-group-end {
    width: 100%;
  }
  .fh-dept-toolbar .fh-toolbar-group-end .btn {
    width: 100%;
  }
  .fh-dept-inline-form {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .fh-dept-form {
    max-width: 100%;
  }
}
@media (max-width: 575.98px) {
  .fh-dept-page .table th:nth-child(4),
  .fh-dept-page .table td.fh-dept-meter {
    display: none;
  }
}

