/* Manage Locates — board table + detail drawer */

.mp-main--locates {
  position: relative;
}

.ml-toolbar {
  flex-wrap: wrap;
}

.ml-board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ml-board[hidden] {
  display: none !important;
}

.ml-group__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.ml-group__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.ml-group__count {
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
}

.ml-table-wrap {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: auto;
  background: var(--surface, #fff);
}

.ml-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ml-col-name { width: 22%; }
.ml-col-status { width: 12%; }
.ml-col-customer { width: 14%; }
.ml-col-city { width: 12%; }
.ml-col-project { width: 14%; }
.ml-col-expire { width: 10%; }
.ml-col-resp { width: 6%; }
.ml-col-crew { width: 10%; }

.ml-table th,
.ml-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #6b7280);
  background: var(--surface-2, #f8fafc);
  font-weight: 600;
}

.ml-table tr:last-child td {
  border-bottom: none;
}

.ml-table tbody tr {
  cursor: pointer;
}

.ml-table tbody tr:hover {
  background: var(--surface-2, #f8fafc);
}

.ml-td-inline {
  overflow: visible;
}

.ml-inline-status {
  appearance: auto;
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--ml-status-border, var(--border, #e5e7eb));
  background: var(--ml-status-bg, var(--surface-2, #f1f5f9));
  padding: 0.15rem 0.45rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  box-sizing: border-box;
}

.ml-inline-expire {
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0.15rem 0.35rem;
  font: inherit;
  font-size: 0.75rem;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  box-sizing: border-box;
}

.ml-drawer__foot {
  gap: 0.5rem;
}

.ml-drawer__foot .mp-btn--danger {
  margin-right: auto;
}

.ml-table__name {
  font-weight: 500;
}

.ml-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-2, #f1f5f9);
  color: var(--text, #111827);
  border: 1px solid transparent;
}

.ml-drawer[hidden] {
  display: none !important;
}

.ml-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.ml-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.ml-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100%;
  background: var(--surface, #fff);
  border-left: 1px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.ml-drawer__head,
.ml-drawer__foot {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ml-drawer__foot {
  border-bottom: none;
  border-top: 1px solid var(--border, #e5e7eb);
  align-items: center;
}

.ml-drawer__title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  line-height: 1.3;
  word-break: break-word;
}

.ml-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.1rem 1.5rem;
}

.ml-drawer__error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.8125rem;
  flex: 1;
}

.ml-section {
  margin-bottom: 1.15rem;
}

.ml-section__title {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
  font-weight: 600;
}

.ml-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.ml-field--full {
  grid-column: 1 / -1;
}

.ml-field label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted, #6b7280);
  margin-bottom: 0.25rem;
}

.ml-field input,
.ml-field select,
.ml-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font: inherit;
  background: var(--surface, #fff);
  color: var(--text, #111827);
}

.ml-field textarea {
  min-height: 72px;
  resize: vertical;
}

.ml-people {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ml-people__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}

.ml-people__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-2, #f1f5f9);
  font-size: 0.75rem;
}

.ml-people__chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--muted, #6b7280);
  font-size: 0.85rem;
  line-height: 1;
}

.ml-people__results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  max-height: 140px;
  overflow: auto;
}

.ml-people__results[hidden] {
  display: none;
}

.ml-people__results button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
}

.ml-people__results button:hover {
  background: var(--surface-2, #f8fafc);
}

.ml-files {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ml-files a,
.ml-file-link {
  color: var(--accent, #2563eb);
  font-size: 0.8125rem;
  text-decoration: underline;
  display: block;
  margin-bottom: 0.25rem;
}

.ml-file-muted {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
  margin-bottom: 0.25rem;
}

.ml-files__upload {
  font-size: 0.8125rem;
}

.ml-empty-row td {
  color: var(--muted, #6b7280);
  font-style: italic;
  white-space: normal;
}

.ml-group-modal[hidden] {
  display: none !important;
}

.ml-group-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ml-group-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.ml-group-modal__panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface, #fff);
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.ml-group-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.ml-group-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted, #6b7280);
}

.ml-group-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ml-group-modal__field input {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}

.ml-group-modal__error {
  margin: 0.75rem 0 0;
  color: #b91c1c;
  font-size: 0.8125rem;
}

.ml-group-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

@media (max-width: 720px) {
  .ml-fields {
    grid-template-columns: 1fr;
  }

  .ml-drawer__panel {
    width: 100%;
  }
}
