/* Sección "Capas" del Centro de Administración. Paleta de audit-view. */

.layers-view__upload,
.layers-view__card {
  border: 1px solid #d7e2e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22, 58, 81, .07);
}

.layers-view__upload {
  margin: 18px 0;
  padding: 18px 20px;
}

.layers-view__upload h3,
.layers-view__body h4 {
  margin: 0 0 6px;
  color: #1e475f;
  font: 800 14px/1.3 "Sora", sans-serif;
}

.layers-view__hint {
  margin: 0 0 12px;
  color: #607784;
  font-size: 12px;
  line-height: 1.5;
}

.layers-view__upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.layers-view__file,
.layers-view__fields label {
  display: grid;
  gap: 5px;
  color: #607784;
  font-size: 12px;
  font-weight: 700;
}

.layers-view__file { flex: 1 1 260px; }
.layers-view__project { flex: 0 1 220px; }

.layers-view__file input,
.layers-view__file select,
.layers-view__fields input,
.layers-view__fields select,
.layers-view__fields textarea {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd9df;
  border-radius: 8px;
  background: #fff;
  color: #183b52;
  font: 400 13px/1.4 "Source Sans 3", sans-serif;
}

.layers-view__fields input[type="color"] {
  width: 56px;
  padding: 4px;
}

.layers-view__fields input[type="range"] {
  padding: 0;
  border: 0;
}

.layers-view__primary,
.layers-view__secondary,
.layers-view__danger {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  font: 700 12px/1.2 "Source Sans 3", sans-serif;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.layers-view__primary {
  border: 1px solid #2b6e96;
  color: #fff;
  background: #2b6e96;
}

.layers-view__primary:hover { background: #1f5a7d; transform: translateY(-1px); }

.layers-view__secondary {
  border: 1px solid #9eb6c4;
  color: #365b70;
  background: transparent;
}

.layers-view__secondary:hover { border-color: #6e96ac; background: rgba(69, 128, 160, .1); }

.layers-view__danger {
  border: 1px solid #c9302c;
  color: #b42318;
  background: transparent;
}

.layers-view__danger:hover { background: rgba(201, 48, 44, .08); }

.layers-view__primary:disabled,
.layers-view__secondary:disabled,
.layers-view__danger:disabled {
  opacity: .55;
  cursor: progress;
  transform: none;
}

.layers-view__upload-message,
.layers-view__card-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: #2f6b4f;
  font-size: 12px;
}

.layers-view__upload-message.is-error,
.layers-view__card-message.is-error,
.layers-view__message.is-error { color: #b42318; }

.layers-view__append-result:empty { display: none; }

.layers-view__append-summary {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #d7e2e7;
  border-radius: 12px;
  background: #f7fafb;
}

.layers-view__append-summary h4 {
  margin: 0;
  color: #1e475f;
  font: 800 13px/1.3 "Sora", sans-serif;
}

.layers-view__append-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layers-view__append-counts li {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8eff2;
  color: #365b70;
  font-size: 12px;
}

.layers-view__append-counts li[data-kind="ok"] { background: #dff3e7; color: #1f6b43; }
.layers-view__append-counts li[data-kind="skip"] { background: #eef1f3; color: #55707e; }
.layers-view__append-counts li[data-kind="error"] { background: #fbe3e1; color: #a1271d; }

.layers-view__append-notes,
.layers-view__append-rows {
  margin: 0;
  padding-left: 18px;
  color: #365b70;
  font-size: 12px;
  line-height: 1.6;
}

.layers-view__append-rows { max-height: 220px; overflow: auto; }

.layers-view__append-block summary {
  color: #365b70;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.layers-view__append-block[data-kind="error"] summary { color: #a1271d; }
.layers-view__append-block[data-kind="warning"] summary { color: #8a5a00; }

.layers-view__batches-title {
  margin: 18px 0 4px;
  color: #1e475f;
  font: 800 13px/1.3 "Sora", sans-serif;
}

.layers-view__batches {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layers-view__batch,
.layers-view__batch-empty {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7f9;
  color: #365b70;
  font-size: 12px;
}

.layers-view__batch[data-undone="true"] { opacity: .7; }

.layers-view__batch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layers-view__batch-head small {
  display: block;
  color: #607784;
}

.layers-view__batch-preview,
.layers-view__batch-done {
  margin: 10px 0 0;
}

.layers-view__batch-preview p { margin: 0 0 6px; }
.layers-view__batch-done { color: #2f6b4f; font-weight: 700; }

html[data-theme="dark"] .layers-view__batches-title { color: #d8e6ee; }
html[data-theme="dark"] .layers-view__batch,
html[data-theme="dark"] .layers-view__batch-empty { background: #172631; color: #c3d6e1; }
html[data-theme="dark"] .layers-view__batch-done { color: #9fdcb7; }

.layers-view__append-files h5 {
  margin: 0 0 6px;
  color: #1e475f;
  font: 800 12px/1.3 "Sora", sans-serif;
}

.layers-view__append-files ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layers-view__append-files label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #365b70;
  font-size: 12px;
}

.layers-view__append-files small { color: #607784; }

.layers-view__append-files select {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #cbd9df;
  border-radius: 8px;
  background: #fff;
  color: #183b52;
  font: 400 13px/1.4 "Source Sans 3", sans-serif;
}

html[data-theme="dark"] .layers-view__append-files h5 { color: #d8e6ee; }
html[data-theme="dark"] .layers-view__append-files label { color: #c3d6e1; }

.layers-view__append-part {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #d7e2e7;
}

.layers-view__append-part h5 {
  margin: 0;
  color: #1e475f;
  font: 800 12px/1.3 "Sora", sans-serif;
}

.layers-view__append-part h5 small {
  color: #607784;
  font: 400 11px/1.3 "Source Sans 3", sans-serif;
}

.layers-view__append-problem {
  margin: 0;
  color: #a1271d;
  font-size: 12px;
  font-weight: 700;
}

html[data-theme="dark"] .layers-view__append-part { border-color: #2f4654; }
html[data-theme="dark"] .layers-view__append-part h5 { color: #d8e6ee; }
html[data-theme="dark"] .layers-view__append-problem { color: #f19a94; }

.layers-view__append-mapping {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

html[data-theme="dark"] .layers-view__append-summary { border-color: #2f4654; background: #172631; }
html[data-theme="dark"] .layers-view__append-summary h4 { color: #d8e6ee; }
html[data-theme="dark"] .layers-view__append-counts li { background: #22394a; color: #c3d6e1; }
html[data-theme="dark"] .layers-view__append-counts li[data-kind="ok"] { background: #1d3d2c; color: #9fdcb7; }
html[data-theme="dark"] .layers-view__append-counts li[data-kind="error"] { background: #4a1f1c; color: #f19a94; }
html[data-theme="dark"] .layers-view__append-notes,
html[data-theme="dark"] .layers-view__append-rows,
html[data-theme="dark"] .layers-view__append-block summary { color: #c3d6e1; }
html[data-theme="dark"] .layers-view__append-block[data-kind="error"] summary { color: #f19a94; }
html[data-theme="dark"] .layers-view__append-block[data-kind="warning"] summary { color: #f2c46d; }

.layers-view__jobs {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.layers-view__job {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f9fb;
  font-size: 12px;
}

.layers-view__job strong { color: #1e475f; overflow-wrap: anywhere; }
.layers-view__job-detail { grid-column: 2; color: #607784; }

.layers-view__job-status,
.layers-view__badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.layers-view__job-status { grid-row: span 2; color: #365b70; background: #e3edf2; }
.layers-view__job[data-status="done"] .layers-view__job-status { color: #22603f; background: #dcf2e5; }
.layers-view__job[data-status="error"] .layers-view__job-status { color: #a1271d; background: #fbe3e1; }
.layers-view__job[data-status="processing"] .layers-view__job-status { color: #7a5200; background: #fdf0d2; }

.layers-view__list {
  display: grid;
  gap: 10px;
}

.layers-view__card > summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.layers-view__card > summary::-webkit-details-marker { display: none; }
.layers-view__card > summary:hover { background: #f5f9fb; border-radius: 14px; }
.layers-view__card[open] > summary { border-bottom: 1px solid #e7edef; border-radius: 14px 14px 0 0; }

.layers-view__title { display: grid; gap: 3px; min-width: 0; }
.layers-view__title strong { color: #1e475f; font-size: 14px; }
.layers-view__title small { color: #66808f; font-size: 11px; overflow-wrap: anywhere; }

.layers-view__badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.layers-view__badge[data-kind="protected"] { color: #1f4f70; background: #dfecf4; }
.layers-view__badge[data-kind="uploaded"] { color: #5b3f8a; background: #ece5f7; }
.layers-view__badge[data-kind="active"] { color: #22603f; background: #dcf2e5; }
.layers-view__badge[data-kind="inactive"] { color: #6b6b6b; background: #ececec; }

.layers-view__body {
  display: grid;
  gap: 22px;
  padding: 18px;
}

.layers-view__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.layers-view__fields label { min-width: 120px; }
.layers-view__fields .layers-view__wide { flex: 1 1 100%; }
.layers-view__fields .layers-view__name { flex: 0 1 420px; }
.layers-view__fields .layers-view__check {
  display: flex;
  flex: 1 1 100%;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.layers-view__table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
  border: 1px solid #e7edef;
  border-radius: 10px;
}

.layers-view__table {
  width: 100%;
  border-collapse: collapse;
  color: #405e71;
  font-size: 12px;
}

.layers-view__table th,
.layers-view__table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e7edef;
  text-align: center;
}

.layers-view__table tbody tr:last-child th,
.layers-view__table tbody tr:last-child td { border-bottom: 0; }

.layers-view__table th[scope="row"],
.layers-view__table thead th:first-child { text-align: left; }

.layers-view__table thead th {
  color: #66808f;
  background: #f1f6f8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.layers-view__table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2b6e96;
  cursor: pointer;
}

.layers-view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e7edef;
}

.layers-view__empty { color: #607784; }

.layers-view__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Tema oscuro */
html[data-theme="dark"] .layers-view__upload,
html[data-theme="dark"] .layers-view__card {
  border-color: #344a59;
  background: #112734;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .layers-view__upload h3,
html[data-theme="dark"] .layers-view__body h4,
html[data-theme="dark"] .layers-view__title strong,
html[data-theme="dark"] .layers-view__job strong { color: #eef7fb; }

html[data-theme="dark"] .layers-view__hint,
html[data-theme="dark"] .layers-view__title small,
html[data-theme="dark"] .layers-view__job-detail,
html[data-theme="dark"] .layers-view__file,
html[data-theme="dark"] .layers-view__fields label { color: #87a0ae; }

html[data-theme="dark"] .layers-view__file input,
html[data-theme="dark"] .layers-view__fields input,
html[data-theme="dark"] .layers-view__fields textarea {
  border-color: #3b5260;
  background: #1c2c37;
  color: #e6eef2;
}

html[data-theme="dark"] .layers-view__secondary,
html[data-theme="dark"] .layers-view__refresh { border-color: #4f6b7b; color: #b6dbed; }
html[data-theme="dark"] .layers-view__job-status { color: #b6dbed; background: #23404f; }
html[data-theme="dark"] .layers-view__job[data-status="done"] .layers-view__job-status,
html[data-theme="dark"] .layers-view__badge[data-kind="active"] { color: #8fd3ad; background: #173c2b; }
html[data-theme="dark"] .layers-view__job[data-status="error"] .layers-view__job-status { color: #f19a94; background: #4a1f1c; }
html[data-theme="dark"] .layers-view__job[data-status="processing"] .layers-view__job-status { color: #f2cd7b; background: #46360f; }
html[data-theme="dark"] .layers-view__badge[data-kind="protected"] { color: #9fcbe6; background: #1d3b4f; }
html[data-theme="dark"] .layers-view__badge[data-kind="uploaded"] { color: #c9b5ee; background: #33284a; }
html[data-theme="dark"] .layers-view__badge[data-kind="inactive"] { color: #b3bcc2; background: #2c3a42; }
html[data-theme="dark"] .layers-view__danger { border-color: #e0605a; color: #f19a94; }
html[data-theme="dark"] .layers-view__job { background: #18313e; }
html[data-theme="dark"] .layers-view__card > summary:hover { background: #18313e; }

html[data-theme="dark"] .layers-view__card[open] > summary,
html[data-theme="dark"] .layers-view__table-wrap,
html[data-theme="dark"] .layers-view__table th,
html[data-theme="dark"] .layers-view__table td,
html[data-theme="dark"] .layers-view__actions { border-color: #30434f; }

html[data-theme="dark"] .layers-view__table { color: #a9bdc8; }
html[data-theme="dark"] .layers-view__table thead th { color: #87a0ae; background: #1a3442; }
html[data-theme="dark"] .layers-view__upload-message,
html[data-theme="dark"] .layers-view__card-message { color: #8fd3ad; }
html[data-theme="dark"] .layers-view__upload-message.is-error,
html[data-theme="dark"] .layers-view__card-message.is-error { color: #f19a94; }

@media (max-width: 767px) {
  .layers-view__card > summary { flex-direction: column; align-items: flex-start; }
  .layers-view__badges { justify-content: flex-start; }
  .layers-view__upload-form > * { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .layers-view__primary,
  .layers-view__secondary,
  .layers-view__danger { transition: none; }
}
