/* Canonical modal surfaces for investigative and plate-control flows */

.antecedentes-overlay {
  z-index: 72;
  background: rgba(2, 6, 16, 0.82);
  backdrop-filter: blur(14px);
}

.antecedentes-dialog {
  width: min(920px, 100%);
  padding: 18px;
}

.antecedentes-dialog__intro {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.05), transparent 24%),
    rgba(7, 12, 21, 0.86);
}

.antecedentes-dialog__intro strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.antecedentes-dialog__intro span {
  color: rgba(191, 219, 254, 0.74);
  font-size: 13px;
  line-height: 1.55;
}

.antecedentes-dialog__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.antecedentes-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background:
    radial-gradient(circle at top right, rgba(214, 187, 24, 0.05), transparent 22%),
    linear-gradient(180deg, rgba(9, 14, 24, 0.96), rgba(5, 10, 18, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.antecedentes-card__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 187, 24, 0.22);
  background: rgba(214, 187, 24, 0.1);
  color: #f7e79a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.antecedentes-card__body {
  display: grid;
  gap: 6px;
}

.antecedentes-card__body h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.antecedentes-card__body p {
  margin: 0;
  color: rgba(191, 219, 254, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.antecedentes-card .btn {
  width: fit-content;
}

.photo-dialog--plate-control {
  width: min(1180px, 96vw);
}

.plate-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 18px;
}

.plate-control-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.plate-control-panel__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.plate-control-panel__head h3 {
  margin: 4px 0 0;
}

.plate-control-list {
  display: grid;
  gap: 12px;
}

.plate-control-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(6, 12, 22, 0.72);
}

.plate-control-item__main {
  display: grid;
  gap: 6px;
}

.plate-control-item__main strong {
  font-size: 15px;
}

.plate-control-item__main span {
  color: var(--muted);
  font-size: 13px;
}

.plate-control-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.plate-control-item__actions {
  justify-content: flex-end;
}

body[data-theme-mode="light"][data-user-theme="true"] .live-overlay {
  background: rgba(241, 245, 249, 0.76);
  backdrop-filter: blur(12px);
}

body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-overlay {
  background: rgba(241, 245, 249, 0.82);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog,
body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog,
body[data-theme-mode="light"][data-user-theme="true"] .recorder-rename-dialog {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background:
    radial-gradient(circle at top left, rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.09), transparent 24%),
    radial-gradient(circle at top right, rgba(214, 187, 24, 0.05), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(var(--user-theme-panel-rgb, 244, 247, 251), 0.95));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    0 28px 70px rgba(15, 23, 42, 0.16);
  color: var(--ui-text-strong, #0f172a);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__header {
  border-bottom-color: var(--ui-surface-card-divider, rgba(15, 23, 42, 0.08));
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__eyebrow {
  color: rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.88);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__header h2,
body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-dialog__intro strong,
body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-card__body h3,
body[data-theme-mode="light"][data-user-theme="true"] .plate-control-panel__head h3,
body[data-theme-mode="light"][data-user-theme="true"] .plate-control-item__main strong,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__header strong,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__item strong {
  color: var(--ui-text-strong, #0f172a);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__header p,
body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-dialog__intro span,
body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-card__body p,
body[data-theme-mode="light"][data-user-theme="true"] .plate-control-item__main span,
body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__footnote,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__header span,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__group-label,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__range-note,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__item span,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail__empty {
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__action,
body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__close {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ui-text-strong, #0f172a);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__action:hover,
body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__close:hover {
  border-color: rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.24);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__media,
body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__footnote,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-dialog__footnote,
body[data-theme-mode="light"][data-user-theme="true"] .live-rail {
  background:
    radial-gradient(circle at top left, rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.06), transparent 28%),
    rgba(255, 255, 255, 0.84);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-rail__item {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background: rgba(255, 255, 255, 0.76);
}

body[data-theme-mode="light"][data-user-theme="true"] .live-rail__empty {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

body[data-theme-mode="light"][data-user-theme="true"] .recorder-rename-dialog__feedback {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.94);
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .recorder-rename-dialog__feedback.is-success {
  border-color: var(--ui-success-border, rgba(22, 163, 74, 0.24));
  background: var(--ui-success-bg, rgba(34, 197, 94, 0.12));
  color: var(--ui-success-text, #166534);
}

body[data-theme-mode="light"][data-user-theme="true"] .recorder-rename-dialog__feedback.is-error {
  border-color: var(--ui-danger-border, rgba(220, 38, 38, 0.24));
  background: var(--ui-danger-bg, rgba(239, 68, 68, 0.12));
  color: var(--ui-danger-text, #b91c1c);
}

body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-dialog__intro,
body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-card,
body[data-theme-mode="light"][data-user-theme="true"] .plate-control-panel {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background: var(--ui-surface-card-bg);
  box-shadow: var(--ui-surface-card-shadow);
}

body[data-theme-mode="light"][data-user-theme="true"] .antecedentes-card__badge {
  border-color: var(--ui-warning-border, rgba(217, 119, 6, 0.24));
  background: var(--ui-warning-bg, rgba(245, 158, 11, 0.14));
  color: var(--ui-warning-text, #92400e);
}

body[data-theme-mode="light"][data-user-theme="true"] .plate-control-item {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background: var(--ui-surface-soft-bg-strong, rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

@media (max-width: 980px) {
  .plate-control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .plate-control-item {
    grid-template-columns: 1fr;
  }

  .plate-control-item__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .antecedentes-dialog__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .antecedentes-dialog,
  .photo-dialog--plate-control {
    width: min(100%, calc(100dvw - 24px));
    padding: 14px;
  }

  .antecedentes-card,
  .plate-control-panel {
    padding: 14px;
    border-radius: 18px;
  }
}

@media (max-width: 760px) {
  .antecedentes-dialog,
  .photo-dialog--plate-control {
    width: min(100%, calc(100dvw - 16px));
    padding: 12px;
  }

  .antecedentes-dialog__grid,
  .plate-control-grid {
    grid-template-columns: 1fr !important;
  }

  .plate-control-panel__head {
    flex-direction: column;
    align-items: stretch;
  }

  .antecedentes-card .btn,
  .plate-control-item__actions,
  .plate-control-item__actions .btn,
  .plate-control-item__actions .table-action-link {
    width: 100%;
  }

  .plate-control-item__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .antecedentes-dialog__intro,
  .antecedentes-card,
  .plate-control-panel,
  .plate-control-item {
    padding: 12px;
    border-radius: 16px;
  }
}
