/* Catálogos claros — azul / cian / violeta · mobile-first */

.elx-page,
.elx-form,
.elx-card {
  --elx-bg: #F5F8FA;
  --elx-card: #FFFFFF;
  --elx-soft: #F0F7F6;
  --elx-text: #121826;
  --elx-muted: #5B6475;
  --elx-line: rgba(18, 16, 128, 0.1);
  --elx-navy: #121080;
  --elx-cyan: #00E6E6;
  --elx-cyan-deep: #16B6DC;
  --elx-green: #14B8A6;
  --elx-green-soft: #5EEAD4;
  --elx-violet: #7226B9;
  --elx-violet-soft: #B266E5;
  --elx-input: #FFFFFF;
  --elx-stroke: #D5DDEA;
  --elx-accent-wash: color-mix(in srgb, var(--elx-green) 6%, color-mix(in srgb, var(--elx-cyan) 5%, white));
}

.elx-page {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  color: var(--elx-text);
  background: transparent;
  font-family: "Exo2", "Segoe UI", sans-serif;
}

.elx-page *,
.elx-page *::before,
.elx-page *::after { box-sizing: border-box; }

.elx-page.is-compact {
  padding: 0;
  height: auto;
}

/* Ficha de ingreso — contenedor full-height */
.fi-shell {
  height: 100%;
  min-height: 0;
}

.fi-shell__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fi-shell__body > .lat-page {
  flex: 1 1 auto;
  min-height: 0;
}

.elx-page__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.15rem 0.55rem 0.75rem;
  border: 0;
  border-radius: 0;
  border-left: 3px solid color-mix(in srgb, var(--elx-green) 55%, var(--elx-violet));
  background: transparent;
  box-shadow: none;
}

.elx-page__title::before {
  display: none;
}

.elx-page__title h1 {
  margin: 0;
  color: var(--elx-navy);
  font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.elx-page__title p {
  margin: 0.12rem 0 0;
  color: var(--elx-muted);
  font-size: 0.78rem;
}

.elx-back {
  display: none;
}

.elx-split {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.elx-split__list,
.elx-split__form {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.elx-split__list > *,
.elx-split__form > * {
  flex: 1 1 auto;
  min-height: 0;
}

/* Móvil: listado O detalle */
.elx-page.is-list .elx-split__form { display: none !important; }
.elx-page.is-detail .elx-split__list { display: none !important; }

.elx-page.is-detail .elx-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--elx-line);
  border-radius: 12px;
  color: var(--elx-navy);
  background: #fff;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(18, 16, 128, 0.06);
}

.elx-card {
  min-width: 0;
  height: 100%;
  padding: 0.7rem;
  border: 1px solid var(--elx-line);
  border-radius: 12px;
  background: var(--elx-card);
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.elx-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}

.elx-card__head h3 {
  margin: 0;
  color: var(--elx-navy);
  font-size: 0.98rem;
  font-weight: 780;
}

.elx-card__head p {
  margin: 0.1rem 0 0;
  color: var(--elx-muted);
  font-size: 0.74rem;
}

.elx-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.elx-card__actions fluent-button {
  flex: 1 1 auto;
  min-height: 2.5rem;
}

.elx-card .dilitium-datagrid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

.elx-card .datagrid-toolbar {
  flex-shrink: 0;
  background: transparent !important;
  border-bottom: 1px solid var(--elx-line) !important;
  padding: 0.2rem 0 0.45rem !important;
}

.elx-card .datagrid-container {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

.elx-card .datagrid-pagination {
  flex-shrink: 0 !important;
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.45rem !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.55rem 0.35rem !important;
  margin-top: auto;
  background: #FFFFFF !important;
  border-top: 1px solid var(--elx-line) !important;
}

.elx-card .pagination-info {
  flex: 1 1 140px;
  min-width: 0;
  white-space: normal !important;
  font-size: 0.72rem !important;
  line-height: 1.3;
}

.elx-card .pagination-controls {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.4rem !important;
  flex: 1 1 180px;
}

.elx-card .pagination-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
}

.elx-card .btn-page {
  min-width: 2rem !important;
  height: 2rem !important;
}

.elx-check.is-readonly {
  opacity: 0.78;
  cursor: default;
}

.elx-check fluent-switch {
  flex-shrink: 0;
}

.elx-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  color: var(--elx-text);
}

.elx-form__bar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--elx-line);
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: none;
}

.elx-form__bar h2 {
  margin: 0;
  color: var(--elx-navy);
  font-size: 1rem;
  font-weight: 780;
}

.elx-form__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  color: var(--elx-muted);
  font-size: 0.74rem;
}

.elx-form__placa {
  color: var(--elx-cyan-deep);
  font-weight: 780;
}

.elx-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--elx-green) 28%, transparent);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--elx-green) 70%, var(--elx-navy));
  background: color-mix(in srgb, var(--elx-green-soft) 22%, white);
}

.elx-chip.is-edit {
  color: var(--elx-violet);
  border-color: color-mix(in srgb, var(--elx-violet) 28%, transparent);
  background: color-mix(in srgb, var(--elx-violet-soft) 16%, white);
}

.elx-form__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  width: 100%;
}

.elx-form__actions fluent-button {
  min-height: 2.55rem;
  width: 100%;
}

.elx-form__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem;
  border: 1px solid var(--elx-line);
  border-radius: 12px;
  background: #FFFFFF;
}

.elx-block {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--elx-line);
}

.elx-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.elx-block > h3,
.elx-block__head {
  margin: 0 0 0.55rem;
  color: var(--elx-violet);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.elx-block__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--elx-navy);
  letter-spacing: 0.04em;
}

.elx-block__icon {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  color: var(--elx-navy);
  background: color-mix(in srgb, var(--elx-green-soft) 28%, color-mix(in srgb, var(--elx-violet-soft) 12%, white));
  border: 1px solid color-mix(in srgb, var(--elx-green) 22%, var(--elx-violet) 12%);
  box-shadow: none;
  flex-shrink: 0;
}

.elx-block__icon fluent-icon,
.elx-block__icon svg {
  color: color-mix(in srgb, var(--elx-green) 45%, var(--elx-violet)) !important;
}

.elx-block__head span {
  color: var(--elx-navy);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.elx-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  color: var(--elx-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.elx-label svg {
  color: var(--elx-cyan-deep);
  width: 14px;
  height: 14px;
}

.elx-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.elx-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--elx-line);
  border-radius: 12px;
  background: #FFFFFF;
}

.elx-check__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.elx-check__text strong {
  color: var(--elx-navy);
  font-size: 0.82rem;
  font-weight: 750;
}

.elx-check__text span {
  color: var(--elx-muted);
  font-size: 0.68rem;
}

.elx-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--elx-green) 18%, var(--elx-line));
  border-radius: 12px;
  background: var(--elx-accent-wash);
}

@media (min-width: 640px) {
  .elx-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.elx-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.elx-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.elx-field--full { grid-column: 1 / -1; }

.elx-field label,
.elx-form .form-label {
  margin: 0;
  color: var(--elx-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.elx-form .fila-flex {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  align-items: start;
}

.elx-form .columna-flex {
  width: 100% !important;
  margin: 0 !important;
  min-width: 0;
}

.elx-form .container-half {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.elx-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.elx-inline > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.elx-page fluent-text-field,
.elx-page fluent-number-field,
.elx-page fluent-select,
.elx-page fluent-combobox,
.elx-page fluent-search,
.elx-page fluent-autocomplete,
.elx-form fluent-text-field,
.elx-form fluent-number-field,
.elx-form fluent-select,
.elx-form fluent-combobox,
.elx-form fluent-search,
.elx-form fluent-autocomplete,
.elx-card fluent-text-field,
.elx-card fluent-combobox,
.elx-card fluent-autocomplete {
  width: 100%;
  max-width: 100%;
  min-height: 2.45rem;
  --neutral-foreground-rest: var(--elx-text);
  --neutral-foreground-hint: var(--elx-muted);
  --neutral-fill-input-rest: var(--elx-input);
  --neutral-stroke-input-rest: var(--elx-stroke);
  --neutral-stroke-input-hover: var(--elx-cyan-deep);
  --neutral-stroke-input-focus: var(--elx-navy);
  --accent-fill-rest: var(--elx-navy);
}

fluent-anchored-region,
fluent-anchored-region fluent-listbox {
  --neutral-layer-floating: #fff;
  --neutral-foreground-rest: #121826;
  color: #121826;
  background: #fff;
}

.elx-form fluent-card,
.elx-form__body fluent-card {
  --fill-color: transparent;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.elx-btn-primary {
  --accent-fill-rest: #121080 !important;
  --accent-fill-hover: #7226B9 !important;
  --foreground-on-accent-rest: #ffffff !important;
}

.elx-btn-search {
  flex: 0 0 auto !important;
  min-width: 2.45rem !important;
  min-height: 2.45rem !important;
  border-radius: 0.65rem !important;
  border-color: color-mix(in srgb, var(--elx-cyan-deep) 40%, transparent) !important;
}

.elx-form .text-danger,
.elx-form .validation-message {
  color: #E11D48 !important;
  font-size: 0.72rem;
}

.elx-modal-body {
  min-height: 320px;
  max-height: min(72vh, 680px);
}

/* Tablet+ : split listado | formulario */
@media (min-width: 900px) {
  .elx-page.is-list .elx-split__form,
  .elx-page.is-detail .elx-split__form,
  .elx-page.is-list .elx-split__list,
  .elx-page.is-detail .elx-split__list {
    display: flex !important;
  }

  .elx-page .elx-back { display: none !important; }

  .elx-split {
    grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
    gap: 0.65rem;
  }

  .elx-card__actions {
    width: auto;
  }

  .elx-card__actions fluent-button {
    flex: 0 1 auto;
  }

  .elx-form__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .elx-form__actions {
    display: flex;
    width: auto;
    grid-template-columns: none;
  }

  .elx-form__actions fluent-button {
    width: auto;
  }

  .elx-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .elx-fields.elx-fields--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .elx-form .fila-flex,
  .elx-form .container-half {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .elx-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .elx-split {
    grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  }

  .elx-fields.elx-fields--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Catálogos rápidos desde el formulario de vehículo */
.elx-modal-catalogo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: min(860px, 78vw);
  max-height: min(76vh, 720px);
  padding: 0.25rem;
  color: var(--elx-text, #121826);
}

.elx-modal-catalogo__toolbar,
.elx-modal-catalogo__editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.elx-modal-catalogo__toolbar strong,
.elx-modal-catalogo__editor h3 {
  display: block;
  margin: 0;
  color: var(--elx-text, #121826);
  font-size: 1rem;
  font-weight: 800;
}

.elx-modal-catalogo__toolbar span {
  display: block;
  margin-top: 0.2rem;
  color: var(--elx-muted, #657085);
  font-size: 0.76rem;
}

.elx-modal-catalogo__layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.2fr);
  gap: 0.85rem;
  min-height: 360px;
  overflow: hidden;
}

.elx-modal-catalogo__list,
.elx-modal-catalogo__editor {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--elx-stroke, #d9dfe9);
  border-radius: 0.85rem;
  background: var(--elx-surface, #fff);
}

.elx-modal-catalogo__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: auto;
}

.elx-modal-catalogo__grid-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 0.42fr);
  gap: 0.6rem;
  padding: 0 0.7rem 0.45rem;
  border-bottom: 1px solid var(--elx-stroke, #d9dfe9);
  color: var(--elx-muted, #657085);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.elx-modal-catalogo__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 0.42fr);
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: var(--elx-text, #121826);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.elx-modal-catalogo__item:hover,
.elx-modal-catalogo__item.is-selected {
  border-color: color-mix(in srgb, var(--elx-cyan-deep, #178a9a) 35%, transparent);
  background: color-mix(in srgb, var(--elx-cyan, #16b6dc) 9%, transparent);
}

.elx-modal-catalogo__item span {
  overflow: hidden;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elx-modal-catalogo__item small {
  overflow: hidden;
  color: var(--elx-muted, #657085);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elx-modal-catalogo__empty {
  color: var(--elx-muted, #657085);
  font-size: 0.7rem;
}

.elx-modal-catalogo__editor {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.elx-modal-catalogo__editor-head {
  margin-bottom: 0.1rem;
}

.elx-modal-catalogo__eyebrow {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--elx-cyan-deep, #178a9a);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dl-shell.theme-dark .elx-modal-catalogo__list,
.dl-shell.theme-dark .elx-modal-catalogo__editor {
  border-color: #40365e;
  background: #18142e;
}

.dl-shell.theme-dark .elx-modal-catalogo,
.dl-shell.theme-dark .elx-modal-catalogo__toolbar strong,
.dl-shell.theme-dark .elx-modal-catalogo__editor h3,
.dl-shell.theme-dark .elx-modal-catalogo__item {
  color: #f8f7ff;
}

@media (max-width: 700px) {
  .elx-modal-catalogo {
    min-width: 0;
    width: 100%;
    max-height: 80vh;
  }

  .elx-modal-catalogo__layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .elx-modal-catalogo__list {
    max-height: 190px;
  }
}
