:root {
  color-scheme: light;
  --bg: #f8fafd;
  --surface: #fff;
  --surface-soft: #f1f4f9;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #dfe4ec;
  --blue: #007d96;
  --green: #188038;
  --amber: #b06000;
  --red: #d93025;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(60, 64, 67, .14), 0 1px 3px rgba(60, 64, 67, .1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Google Sans Flex", "Google Sans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 330;
  color: var(--text);
  background: transparent;
  letter-spacing: 0;
  line-height: 1.45;
}

html { background: #fff; }

body {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #fff;
  background-image:
    radial-gradient(1080px circle at 7% -14%, rgba(0, 125, 150, .34) 0%, rgba(0, 125, 150, .18) 32%, rgba(0, 125, 150, 0) 66%),
    radial-gradient(920px circle at 104% 2%, rgba(0, 125, 150, .26) 0%, rgba(0, 125, 150, .13) 30%, rgba(0, 125, 150, 0) 64%),
    radial-gradient(1060px circle at 82% 112%, rgba(0, 125, 150, .20) 0%, rgba(0, 125, 150, .09) 38%, rgba(0, 125, 150, 0) 70%),
    radial-gradient(880px circle at 32% 48%, rgba(229, 245, 248, .98) 0%, rgba(248, 250, 253, .78) 42%, rgba(255, 255, 255, 0) 76%),
    linear-gradient(180deg, #fff 0%, #edf4ff 42%, #fff 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
/* Énfasis por defecto: alineado con títulos de tarjeta (390) y por debajo de h1–h3 (360). */
strong { font-weight: 390; }
small { line-height: 1.35; }

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: 300;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  vertical-align: middle;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.menu-button,
.nav-backdrop {
  display: none;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background-color: rgba(255, 255, 255, .50);
  background-image:
    radial-gradient(820px circle at 12% 0%, rgba(0, 125, 150, .18) 0%, rgba(0, 125, 150, 0) 62%),
    radial-gradient(720px circle at 110% 30%, rgba(0, 125, 150, .13) 0%, rgba(0, 125, 150, 0) 58%);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px 24px;
  font-size: 31px;
  font-weight: 330;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
}

.brand-mark img {
  width: 54px;
  height: 54px;
  display: block;
}

.side-nav nav { display: grid; gap: 4px; }

.side-nav nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  color: #3c4043;
}

.side-nav nav a:hover, .side-nav nav a:focus-visible {
  background: #e5f5f8;
  color: #005f74;
  outline: none;
}

.content-shell { min-width: 0; }

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 32px;
  background-color: rgba(255, 255, 255, .46);
  background-image:
    radial-gradient(980px circle at 22% -30%, rgba(0, 125, 150, .22) 0%, rgba(0, 125, 150, 0) 60%),
    radial-gradient(920px circle at 92% 0%, rgba(0, 125, 150, .16) 0%, rgba(0, 125, 150, 0) 58%);
  backdrop-filter: blur(20px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(680px, 100%);
  min-height: 48px;
  padding: 0 16px;
  background: #edf5f7;
  border: 1px solid transparent;
  border-radius: 24px;
}

.search-box:focus-within { background: white; border-color: var(--line); box-shadow: var(--shadow); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.top-ai-toggle-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

/* Tooltip instantáneo al hover/focus; pointer-events: none para no interceptar clics en el interruptor. */
.top-ai-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  width: min(300px, calc(100vw - 24px));
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #303134;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 330;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  box-shadow: 0 4px 18px rgba(32, 33, 36, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 200;
  transition: none;
}

.top-ai-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom-color: #303134;
}

.top-ai-toggle-wrap:is(:hover, :focus-within) .top-ai-tooltip {
  opacity: 1;
  visibility: visible;
}

.top-ai-toggle {
  flex: 0 0 auto;
}

.top-ai-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 10px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
  color: #3c4043;
  cursor: pointer;
}

.top-ai-toggle input[type="checkbox"] {
  width: 36px;
  height: 22px;
  min-height: 0;
  padding: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.top-ai-toggle .material-symbols-rounded {
  color: var(--blue);
  font-size: 20px;
}

.top-ai-toggle strong {
  display: block;
  font-weight: 390;
  white-space: nowrap;
  line-height: 1.15;
}

.top-ai-toggle small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.role-switcher {
  display: inline-grid;
  grid-template-columns: 22px minmax(132px, 190px);
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 7px 10px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: white;
}

.role-switcher > .material-symbols-rounded {
  color: var(--blue);
  font-size: 20px;
}

.role-switcher label {
  gap: 1px;
  min-width: 0;
}

.role-switcher small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.role-switcher select {
  min-height: 24px;
  padding: 0 24px 0 0;
  border: 0;
  border-radius: 0;
  color: #263d49;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) 52%, calc(100% - 6px) 52%;
  font-size: 14px;
  box-shadow: none;
}

.role-switcher select:hover {
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) 52%, calc(100% - 6px) 52%;
  border: 0;
  box-shadow: none;
}

.role-switcher select:focus,
.role-switcher select:focus-visible {
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) 52%, calc(100% - 6px) 52%;
  box-shadow: none;
  border: 0;
  outline: none;
}

.role-switcher:focus-within {
  box-shadow: 0 0 0 3px #cce9ee, inset 0 0 0 1px #72cbdc;
  border-color: #72cbdc;
}

.profile-pill {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 10px;
  align-items: center;
  min-width: 224px;
  min-height: 52px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
}

.profile-pill .material-symbols-rounded { grid-row: span 2; color: var(--blue); }
.profile-pill small { color: var(--muted); font-size: 12px; }

.page-content { padding: 12px 32px 48px; }

.page-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 26px;
}

.page-heading > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e5f5f8;
  color: var(--blue);
}

.page-heading p, .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1, h2, h3 { margin: 0; font-weight: 360; }
h1 { font-size: clamp(30px, 5vw, 56px); line-height: 1.02; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.grid { display: grid; gap: 16px; }
.grid.metrics { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); align-items: start; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.quick-nav {
  position: sticky;
  top: 76px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 16px 0 22px;
  padding: 14px 20px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 20px;
  scroll-behavior: smooth;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
}

.quick-nav::-webkit-scrollbar {
  height: 6px;
}

.quick-nav::-webkit-scrollbar-track {
  margin: 0 12px;
  border-radius: 4px;
  background: rgba(223, 228, 236, 0.5);
}

.quick-nav::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #b8c5dc;
}

.quick-nav::-webkit-scrollbar-thumb:hover {
  background: #9aa7c0;
}

.quick-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, #c3d0e6);
  border-radius: 20px;
  color: #3c4043;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease;
}

.quick-nav a:hover {
  background: #e5f5f8;
  border-color: #c9e3e9;
  color: #005f74;
}

.quick-nav a:focus-visible {
  background: #e5f5f8;
  border-color: #72cbdc;
  color: #005f74;
  outline: 2px solid #72cbdc;
  outline-offset: 2px;
}

.quick-nav a:active {
  background: #cce9ee;
  border-color: #a3c0f5;
  transform: translateY(0.5px);
}

.quick-nav .material-symbols-rounded {
  font-size: 18px;
  color: var(--muted);
  transition: color 0.14s ease;
}

.quick-nav a:hover .material-symbols-rounded,
.quick-nav a:focus-visible .material-symbols-rounded {
  color: var(--blue);
}

@media (max-width: 700px) {
  .quick-nav {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 16px 14px;
    margin: 14px 0 18px;
    scroll-snap-type: x proximity;
    border-radius: 10px;
  }

  .quick-nav a {
    scroll-snap-align: start;
    min-height: 44px;
    padding: 8px 14px;
  }
}

.surface, .metric, .case-row, .table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.surface { padding: 22px; }
.metric { padding: 18px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  font-weight: 330;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.metric-focus {
  border-color: #c9e3e9;
  background: linear-gradient(180deg, #fff 0%, #f6f9ff 100%);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.case-list { display: grid; gap: 10px; }
.compact-list .case-row { padding: 14px; }

/* Bandeja Expedientes: tarjetas alineadas al tablero (carga por área) */
.expedientes-filters {
  border-color: #c9e3e9;
  background: linear-gradient(180deg, #fff 0%, #f6f9ff 100%);
}

.expedientes-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.expedientes-bandeja .section-title {
  margin-bottom: 18px;
}

.expediente-case-list {
  display: grid;
  gap: 14px;
}

.expediente-case-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas: "icon body badges";
  gap: 12px 16px;
  align-items: center;
  padding: 16px 18px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--area-color) 22%, var(--line));
  background:
    radial-gradient(200px circle at 100% 0%, color-mix(in srgb, var(--area-color) 16%, transparent), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--area-bg));
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.expediente-case-card:hover {
  border-color: color-mix(in srgb, var(--area-color) 42%, var(--line));
  box-shadow:
    0 2px 10px rgba(60, 64, 67, 0.1),
    0 10px 22px color-mix(in srgb, var(--area-color) 12%, transparent);
}

.expediente-case-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--area-color) 45%, white);
  outline-offset: 2px;
}

.expediente-case-card::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--area-color);
}

.expediente-case-card > .material-symbols-rounded {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--area-color);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent);
  font-size: 22px;
}

.expediente-case-card-main {
  grid-area: body;
  min-width: 0;
}

.expediente-case-card-main h3 {
  margin: 0 0 7px;
  line-height: 1.28;
  color: #263d49;
  font-weight: 360;
}

.expediente-case-card-badges {
  grid-area: badges;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 720px) {
  .expediente-case-card {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "icon body"
      "badges badges";
  }

  .expediente-case-card-badges {
    justify-content: flex-start;
  }
}

/* Inicio: bloque completo bajo el tablero (activos + cierres); cierres no van en columna estrecha. */
.dashboard-home-cases {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

/* Inicio: activos y cierres en la misma lógica de rejilla (1 → 2 → 3 columnas). No afecta bandeja/Logística/Reportes. */
.dashboard-home-cases .expediente-case-list,
.expediente-cierre-list {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 720px) {
  .dashboard-home-cases .expediente-case-list,
  .expediente-cierre-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .dashboard-home-cases .expediente-case-list,
  .expediente-cierre-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Inicio (activos): el layout de 3 col de página deja la tarjeta estrecha; icono + cuerpo en una franja, badges abajo, meta en grilla. */
.dashboard-home-cases .expediente-case-card {
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "icon body"
    "badges badges";
  align-items: start;
  row-gap: 14px;
  column-gap: 14px;
  padding: 18px 20px;
}

.dashboard-home-cases .expediente-case-card > .material-symbols-rounded {
  margin-top: 2px;
}

.dashboard-home-cases .expediente-case-card-main h3 {
  font-size: 16px;
  line-height: 1.32;
  font-weight: 360;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.dashboard-home-cases .expediente-case-card .case-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  padding-top: 1px; /* aire bajo el título antes de la rejilla de datos */
}

.dashboard-home-cases .expediente-case-card .case-meta > span {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}

.dashboard-home-cases .expediente-case-card-badges {
  justify-content: flex-start;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--area-color) 20%, var(--line));
  margin: 0;
  width: 100%;
  gap: 8px 10px;
}

.expediente-cierre-card {
  position: relative;
  display: block;
  padding: 20px 22px 22px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--area-color) 22%, var(--line));
  background:
    radial-gradient(220px circle at 100% 0%, color-mix(in srgb, var(--area-color) 16%, transparent), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), var(--area-bg));
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.expediente-cierre-card:hover {
  border-color: color-mix(in srgb, var(--area-color) 40%, var(--line));
  box-shadow:
    0 2px 10px rgba(60, 64, 67, 0.1),
    0 10px 24px color-mix(in srgb, var(--area-color) 12%, transparent);
}

.expediente-cierre-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--area-color) 45%, white);
  outline-offset: 2px;
}

.expediente-cierre-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--area-color);
}

.expediente-cierre-card__row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.expediente-cierre-card__icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--area-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent);
  font-size: 24px;
}

.expediente-cierre-card__lead {
  flex: 1;
  min-width: 0;
}

.expediente-cierre-card__lead h3 {
  margin: 0 0 8px;
  line-height: 1.3;
  font-size: 1.1rem;
  font-weight: 360;
  color: #263d49;
}

.expediente-cierre-card__fecha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.expediente-cierre-card__fecha .material-symbols-rounded {
  font-size: 18px;
  color: var(--area-color);
  opacity: 0.9;
}

.expediente-cierre-card__fecha strong {
  color: #3c4043;
  font-weight: 390;
  font-variant-numeric: tabular-nums;
}

.expediente-cierre-card__badges {
  flex: 0 0 auto;
  padding-top: 2px;
}

.expediente-cierre-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--area-color) 14%, var(--line));
}

.cierre-datum {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cierre-datum__label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #80868b;
  line-height: 1.2;
}

.cierre-datum__val {
  font-size: 14px;
  line-height: 1.4;
  color: #3c4043;
  word-break: break-word;
}

@media (max-width: 600px) {
  .expediente-cierre-card__row {
    flex-wrap: wrap;
  }

  .expediente-cierre-card__badges {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-left: 64px;
    margin-top: 4px;
  }

  .expediente-cierre-card__icon {
    flex-basis: 48px;
  }
}

.case-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 17px 18px;
}

.case-row:hover { border-color: #c4d7fb; }
.case-row h3 { margin-bottom: 7px; line-height: 1.28; }
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status-pill, .soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--surface-soft);
  color: #3c4043;
  font-size: 13px;
  white-space: nowrap;
  line-height: 1;
}

.status-pill.ok { background: #e6f4ea; color: var(--green); }
.status-pill.warn { background: #fef7e0; color: var(--amber); }
.status-pill.block { background: #fce8e6; color: var(--red); }
.status-pill.info { background: #e5f5f8; color: #005f74; }

.primary-action, .secondary-action, .danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 21px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.primary-action .material-symbols-rounded {
  color: #fff;
}

.secondary-action .material-symbols-rounded,
.danger-action .material-symbols-rounded {
  color: currentColor;
}

.primary-action { background: var(--blue); color: white; }
.secondary-action { background: white; border-color: var(--line); color: #005f74; }
.danger-action { background: #fce8e6; color: var(--red); }
.primary-action:hover { background: #1765cc; box-shadow: var(--shadow); }
.secondary-action:hover { background: #f8fafd; border-color: #c7d2e4; }
.primary-action:active, .secondary-action:active, .danger-action:active { transform: translateY(1px); }
.primary-action:disabled, .secondary-action:disabled { opacity: .45; cursor: not-allowed; }

.form-shell { display: grid; gap: 18px; max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }

.registration-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin: 18px 0 14px; }
.registration-hero-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; color: #005f74; background: #e5f5f8; }
.registration-hero-icon .material-symbols-rounded { font-size: 28px; }
.registration-hero-copy h1 { font-size: clamp(30px, 4vw, 42px); }
.registration-hero-copy > p:last-child { max-width: 680px; margin: 6px 0 0; color: var(--muted); }
.registration-hero-status { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 17px; color: #137333; background: #e6f4ea; font-size: 13px; }
.registration-hero-status .material-symbols-rounded { font-size: 18px; }
.registration-overview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.registration-overview strong { color: #005f74; font-weight: 500; }
.registration-overview [aria-hidden="true"] { width: 4px; height: 4px; border-radius: 50%; background: #9aa0a6; }
.registration-form { display: grid; gap: 20px; max-width: 1180px; }
.registration-section { display: grid; gap: 22px; padding: 0 24px 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(60, 64, 67, .08); }
.registration-section::before { content: ""; height: 4px; margin: 0 -24px; background: linear-gradient(90deg, #007d96, #72cbdc); }
.registration-section-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.registration-section-header > .material-symbols-rounded { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #005f74; background: #edf5f7; }
.registration-section h2 { font-size: 20px; }
.registration-section-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.registration-section-count { padding: 5px 10px; border-radius: 14px; color: #5f6368; background: #f1f3f4; font-size: 12px; white-space: nowrap; }
.registration-section .form-grid { gap: 22px 18px; }
.registration-sections { display: grid; gap: 14px; }
.registration-accordion { position: relative; overflow: hidden; border: 1px solid #dadce0; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.08); transition: border-color .2s ease, box-shadow .2s ease; }
.registration-accordion::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #007d96; opacity: 0; transition: opacity .2s ease; }
.registration-accordion[open] { border-color: #c9e3e9; box-shadow: 0 5px 18px rgba(60,64,67,.09); }
.registration-accordion[open]::before { opacity: 1; }
.registration-accordion summary { list-style: none; cursor: pointer; user-select: none; }
.registration-accordion summary::-webkit-details-marker { display: none; }
.registration-accordion .registration-section-header { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 15px; min-height: 102px; padding: 20px 24px; outline: 0; transition: background .18s ease; }
.registration-accordion .registration-section-header:hover { background: #f8fafd; }
.registration-accordion .registration-section-header:focus-visible { box-shadow: inset 0 0 0 3px #cce9ee; }
.registration-accordion .section-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; color: #005f74; background: #e5f5f8; font-size: 24px; }
.registration-accordion .registration-section-header h2 { margin: 0; color: #263d49; font-size: 20px; line-height: 1.3; }
.registration-accordion .registration-section-header p:last-child { max-width: 660px; margin: 4px 0 0; color: #5f6368; font-size: 13px; line-height: 1.45; }
.registration-accordion .registration-section-header .eyebrow { margin: 0 0 2px; color: #006b83; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: none; }
.registration-section-progress { min-width: 122px; padding: 7px 11px; border-radius: 999px; color: #5f6368; background: #f1f3f4; font-size: 12px; text-align: center; white-space: nowrap; }
.registration-section-progress strong { color: #005f74; font-size: 13px; font-weight: 650; }
.registration-section-progress > span { color: inherit; }
.registration-accordion.is-complete .registration-section-progress { color: #137333; background: #e6f4ea; }
.registration-accordion.is-complete .registration-section-progress strong { color: #137333; }
.registration-accordion .section-chevron { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #5f6368; background: transparent; transition: color .18s ease, background .18s ease, transform .22s ease; }
.registration-accordion summary:hover .section-chevron { color: #005f74; background: #e5f5f8; }
.registration-accordion[open] .section-chevron { transform: rotate(180deg); }
.registration-accordion-content { padding: 2px 24px 26px 85px; border-top: 1px solid #edf0f4; animation: registration-section-reveal .22s ease-out; }
.registration-accordion-content .form-grid { gap: 22px 18px; }
.participant-section::before { background: linear-gradient(180deg, #7c4dff, #00b4e5); }
.participant-section .section-icon { color: #673ab7; background: #f1eafe; }
.participant-section .registration-section-header .eyebrow { color: #673ab7; }
.transport-section::before { background: linear-gradient(180deg, #0f9d8b, #007d96); }
.transport-section .section-icon { color: #087f6f; background: #e5f5f2; }
.transport-section .registration-section-header .eyebrow { color: #087f6f; }
.containers-section::before { background: linear-gradient(180deg, #f9ab00, #e37400); }
.containers-section .section-icon { color: #b06000; background: #fef7e0; }
.containers-section .registration-section-header .eyebrow { color: #b06000; }
.cargo-section::before { background: linear-gradient(180deg, #34a853, #0f9d8b); }
.cargo-section .section-icon { color: #137333; background: #e6f4ea; }
.cargo-section .registration-section-header .eyebrow { color: #137333; }
.cargo-description-field { grid-column: 1 / -1; }
@keyframes registration-section-reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.capture-order { display: grid; gap: 10px; }
.capture-order-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.capture-order-heading p { margin: 0; color: #263d49; font-size: 14px; font-weight: 650; }
.capture-order-heading > span { color: #6b7280; font-size: 12px; }
.capture-order-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.capture-order-step { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 58px; padding: 9px 14px; border: 1px solid #dce3ec; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.04); }
.capture-order-step.is-current { border-color: #007d96; background: #f7faff; box-shadow: inset 0 0 0 1px rgba(0, 125, 150,.08); }
.capture-order-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #5f6368; background: #edf1f6; font-size: 12px; font-weight: 700; }
.capture-order-step.is-current .capture-order-number { color: #fff; background: #007d96; }
.capture-order-step.is-complete { border-color: #b7dfc4; background: #f6fbf7; }
.capture-order-step.is-complete .capture-order-number { color: #fff; background: #188038; }
.capture-order-step div { display: grid; gap: 1px; min-width: 0; }
.capture-order-step strong { overflow: hidden; color: #303134; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.capture-order-step small { color: #7a818a; font-size: 10px; }

/* Composición del registro inspirada en la jerarquía visual de Google Workspace. */
.registration-hero { grid-template-columns: 1fr auto; gap: 12px; margin: 8px 0 12px; padding: 4px 0; }
.registration-hero-icon { display: none; }
.registration-hero-copy h1 { margin-top: 2px; font-size: clamp(28px, 3.5vw, 36px); line-height: 1.15; }
.registration-hero-copy > p:last-child { margin-top: 4px; font-size: 13px; }
.registration-hero-status { min-height: 30px; padding: 0 10px; font-size: 11px; }
.registration-overview { gap: 16px; min-height: 50px; margin-bottom: 14px; padding: 10px 16px; border: 1px solid #e0e6ee; border-radius: 12px; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(60,64,67,.05); }
.registration-overview > span:not([aria-hidden]) { display: inline-flex; align-items: center; gap: 4px; }
.registration-form { gap: 14px; }
.ai-intake-card { gap: 12px; padding: 16px 18px; border-color: #d4deeb; border-radius: 13px; background: #fff; box-shadow: 0 2px 7px rgba(60,64,67,.06); }
.ai-intake-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(145deg, #007d96, #006b83); }
.ai-intake-copy h2 { font-size: 16px; }
.ai-intake-copy p, .ai-privacy-note { font-size: 11px; }
.ai-upload-control, .ai-analyze-action { min-height: 38px; }
.ai-selected-files { padding: 8px 11px; border-radius: 8px; }
.ai-review-card { gap: 14px; padding: 18px; border-radius: 14px; box-shadow: 0 2px 8px rgba(60,64,67,.06); }
.ai-review-header > .material-symbols-rounded { width: 42px; height: 42px; border-radius: 12px; font-size: 23px; }
.ai-review-header h2 { font-size: 19px; }
.ai-review-header p:last-child { font-size: 12px; }
.ai-review-summary { border-radius: 11px; }
.ai-review-summary > div { min-height: 58px; padding: 11px 15px; }
.ai-review-summary strong { font-size: 17px; }
.registration-sections { gap: 10px; }
.registration-accordion { border-radius: 12px; box-shadow: 0 2px 7px rgba(60,64,67,.06); }
.registration-accordion::before { width: 4px; opacity: 1; background: #007d96; }
.registration-accordion[open] { border-color: #ccd9e8; box-shadow: 0 3px 10px rgba(60,64,67,.08); }
.registration-accordion .registration-section-header { min-height: 82px; padding: 14px 18px; }
.registration-accordion .section-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; }
.registration-accordion .registration-section-header h2 { font-size: 18px; }
.registration-accordion .registration-section-header p:last-child { margin-top: 2px; font-size: 11px; }
.registration-accordion .registration-section-header .eyebrow { color: #006b83; font-size: 9px; }
.registration-section-progress { min-width: 116px; padding: 6px 9px; font-size: 10px; }
.registration-section-progress strong { font-size: 11px; }
.registration-accordion-content { padding: 5px 18px 20px 68px; }
.registration-accordion-content .form-grid { gap: 14px 12px; }
.material-field { gap: 5px; font-size: 11px; }
.material-field input:not([type="hidden"]), .material-field select { min-height: 44px; border-color: #d6dce5; border-radius: 7px; font-size: 13px; }
.identification-scope-note { margin-top: 14px; padding: 11px 13px; border-radius: 9px; }
.registration-actions { bottom: 12px; padding: 14px 16px; border-color: #d6e0ec; border-radius: 12px; box-shadow: 0 5px 16px rgba(60,64,67,.12); }
.registration-actions p { font-size: 11px; }
.material-field { display: grid; gap: 8px; min-width: 0; color: #3c4043; font-size: 13px; font-weight: 450; }
.material-field > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-field input:not([type="hidden"]), .material-field select { min-height: 52px; border-color: #b8c5d8; border-radius: 8px; background: #fff; }
.material-field input:not([type="hidden"]):hover, .material-field select:hover { border-color: #5f6368; background: #fff; }
.material-field input:not([type="hidden"]):focus, .material-field select:focus { border-color: #007d96; box-shadow: 0 0 0 1px #007d96; }
.registration-actions { position: sticky; bottom: 16px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid #cce9ee; border-radius: 14px; box-shadow: 0 8px 24px rgba(60, 64, 67, .18); }
.registration-actions strong { font-weight: 500; }
.registration-actions p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.registration-actions .primary-action { min-height: 46px; padding: 0 22px; border-radius: 23px; font-weight: 500; }
.registration-success { color: var(--green); }
.ai-intake-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 20px; border: 1px solid #c9e3e9; border-radius: 16px; background: linear-gradient(135deg, #f8fbfc, #fff); }
.ai-intake-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #007d96, #00b4e5); }
.ai-intake-copy h2 { font-size: 18px; }
.ai-intake-copy p, .ai-privacy-note { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.ai-upload-control { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 1px solid #b8c5d8; border-radius: 21px; color: #005f74; background: #fff; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ai-upload-control:hover { border-color: #72cbdc; background: #f8fbfc; }
.ai-upload-control input { position: absolute; width: 1px; height: 1px; min-height: 1px; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.ai-analyze-action { min-height: 42px; }
.ai-privacy-note { grid-column: 2 / -1; display: flex; align-items: center; gap: 6px; }
.ai-privacy-note .material-symbols-rounded { font-size: 17px; }
.ai-selected-files { grid-column: 2 / -1; display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px dashed #c7d2e4; border-radius: 10px; color: #5f6368; background: rgba(255,255,255,.72); transition: border-color .18s ease, background .18s ease; }
.ai-selected-files.has-files { border-style: solid; border-color: #72cbdc; color: #005f74; background: #f8fbfc; }
.ai-selected-files .material-symbols-rounded { margin-top: 2px; font-size: 20px; }.ai-selected-files div { display: grid; gap: 2px; min-width: 0; }.ai-selected-files strong { font-size: 13px; font-weight: 500; }.ai-selected-files small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-evidence-section { display: grid; gap: 14px; padding: 20px; border: 1px solid #cce9ee; border-radius: 16px; background: #f8fbfc; }
.ai-review-card { display: grid; gap: 22px; padding: 26px; border: 1px solid #cce9ee; border-radius: 24px; background: linear-gradient(145deg, #fff 35%, #f7faff); box-shadow: 0 8px 26px rgba(60,64,67,.08); }
.ai-review-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.ai-review-header > .material-symbols-rounded { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; color: #005f74; background: #e5f5f8; font-size: 27px; }
.ai-review-header .eyebrow { margin: 0 0 3px; color: #006b83; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: none; }
.ai-review-header h2 { margin: 0; color: #263d49; font-size: 23px; line-height: 1.25; }
.ai-review-header p:last-child { margin: 5px 0 0; color: #5f6368; font-size: 14px; line-height: 1.45; }
.ai-review-count { padding: 8px 12px; border-radius: 999px; color: #005f74; background: #e5f5f8; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ai-review-summary { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 1px solid #e1e7f0; border-radius: 18px; background: #fff; }
.ai-review-summary > div { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; min-height: 70px; padding: 14px 18px; border-right: 1px solid #e8eaed; }
.ai-review-summary > div:last-child { border-right: 0; }.ai-review-summary .material-symbols-rounded { color: #188038; font-size: 21px; }.ai-review-summary strong { color: #263d49; font-size: 20px; }.ai-review-summary span:last-child { color: #5f6368; font-size: 13px; }.ai-review-summary .needs-attention .material-symbols-rounded { color: #b06000; }
.container-review { display: grid; gap: 13px; }.container-review-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }.container-review-title h3 { margin: 0; color: #263d49; font-size: 17px; }.container-review-title p { margin: 4px 0 0; color: #5f6368; font-size: 13px; }.container-review-title > .material-symbols-rounded { color: #5f6368; }
.container-review-list { display: grid; gap: 10px; }.container-review-item { display: grid; grid-template-columns: 96px repeat(4, minmax(130px, 1fr)); align-items: end; gap: 12px; padding: 16px; border: 1px solid #dadce0; border-radius: 17px; background: #fff; }
.container-review-number { display: flex; align-items: center; gap: 9px; align-self: center; }.container-review-number > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #005f74; background: #e5f5f8; font-size: 13px; font-weight: 700; }.container-review-number strong { color: #3c4043; font-size: 13px; font-weight: 500; }
.container-review-item label { display: grid; gap: 6px; }.container-review-item label > span { color: #5f6368; font-size: 11px; font-weight: 600; letter-spacing: .02em; }.container-review-item input:not([type="hidden"]), .container-review-item select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #dadce0; border-radius: 10px; color: #263d49; background: #fff; font: inherit; font-size: 14px; }.container-review-item input:focus, .container-review-item select:focus { border-color: #007d96; outline: 1px solid #007d96; }
.container-review-source { grid-column: 2 / -1; display: flex; align-items: center; gap: 6px; color: #5f6368; font-size: 12px; }.container-review-source .material-symbols-rounded { color: #188038; font-size: 17px; }
.container-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0 14px; }
.container-section-heading strong { color: #263d49; font-size: 15px; font-weight: 650; }
.container-section-heading p { margin: 4px 0 0; color: #5f6368; font-size: 12px; line-height: 1.45; }
.container-add-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid #76cddf; border-radius: 20px; color: #006b83; background: #fff; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.container-add-action:hover { border-color: #006b83; background: #f5f9ff; }
.container-add-action .material-symbols-rounded { font-size: 19px; }
.container-capture-list { display: grid; gap: 13px; }
.container-capture-card { overflow: hidden; border: 1px solid #dce3ec; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.05); }
.container-capture-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 14px; border-bottom: 1px solid #edf0f4; background: #f8fafd; }
.container-capture-card > header > div { display: flex; align-items: center; gap: 10px; }
.container-capture-card > header > div > div { display: grid; gap: 1px; }
.container-capture-card > header strong { color: #263d49; font-size: 13px; font-weight: 650; }
.container-capture-card > header small { color: #6b7280; font-size: 10px; }
.container-card-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #8a4b00; background: #fef1c7; font-size: 12px; font-weight: 700; }
.container-remove-action { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: #5f6368; background: transparent; cursor: pointer; }
.container-remove-action[hidden] { display: none; }
.container-remove-action:hover { color: #b3261e; background: #fce8e6; }
.container-remove-action .material-symbols-rounded { font-size: 19px; }
.container-fields-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.container-fields-grid .material-field { gap: 6px; }
.container-fields-grid .material-field > span { color: #5f6368; font-size: 11px; font-weight: 600; }
.container-fields-grid .material-field input, .container-fields-grid .material-field select { min-height: 43px; border-radius: 10px; font-size: 13px; }
.container-ai-source { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 16px 14px; padding: 10px 12px; border: 1px solid #cce9ee; border-radius: 12px; background: #f8fbfc; }
.container-ai-source > .material-symbols-rounded { color: #007d96; font-size: 20px; }
.container-ai-source > div { display: grid; gap: 1px; min-width: 0; }
.container-ai-source small { color: #006b83; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: none; }
.container-ai-source strong { overflow: hidden; color: #3c4043; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.container-ai-source button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px; border: 0; border-radius: 18px; color: #006b83; background: #e5f5f8; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.container-ai-source button:hover { background: #cce9ee; }
.container-ai-source button .material-symbols-rounded { font-size: 15px; }
.container-scope-note > .material-symbols-rounded { color: #b06000; }
.identification-section .registration-section-header .eyebrow { margin: 0 0 3px; color: #006b83; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: none; }
.identification-scope-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; padding: 15px 17px; border-radius: 14px; color: #3c4043; background: #f8fafd; }.identification-scope-note > .material-symbols-rounded { color: #007d96; font-size: 22px; }.identification-scope-note strong { font-size: 13px; font-weight: 600; }.identification-scope-note p { margin: 4px 0 0; color: #5f6368; font-size: 12px; line-height: 1.5; }
.ai-review-warnings { padding: 16px 18px; border: 1px solid #f6d7a7; border-radius: 16px; background: #fffaf1; }.ai-review-warnings > div { display: flex; align-items: center; gap: 9px; }.ai-review-warnings h3 { margin: 0; color: #6f4700; font-size: 15px; }.ai-review-warnings .material-symbols-rounded { color: #b06000; font-size: 21px; }.ai-review-warnings ul { margin: 10px 0 0 30px; padding: 0; color: #5f4b32; font-size: 13px; line-height: 1.55; }
.ai-review-observations { border-color: #cce9ee; background: #f8fbfc; }.ai-review-observations h3 { color: #005f74; }.ai-review-observations .material-symbols-rounded { color: #007d96; }.ai-review-observations ul { color: #3c4043; }
.ai-evidence-heading { display: flex; align-items: center; gap: 12px; }
.ai-evidence-heading > .material-symbols-rounded { color: #005f74; }
.ai-evidence-heading h2 { font-size: 18px; }
.ai-evidence-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.ai-evidence-trigger-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ai-evidence-trigger { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #cce9ee; border-radius: 14px; color: var(--text); background: #fff; cursor: pointer; text-align: left; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }.ai-evidence-trigger:hover { border-color: #72cbdc; box-shadow: 0 4px 12px rgba(0, 125, 150,.14); transform: translateY(-1px); }.ai-evidence-trigger:focus-visible { outline: 3px solid #cce9ee; outline-offset: 2px; }
.ai-evidence-sparkle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #00b4e5, #a855f7); box-shadow: 0 4px 10px rgba(66,133,244,.24); font-size: 20px; }.ai-evidence-trigger-copy { display: grid; min-width: 0; gap: 2px; }.ai-evidence-trigger-copy small { color: #5f6368; font-size: 11px; }.ai-evidence-trigger-copy strong { overflow: hidden; color: #005f74; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }.ai-evidence-trigger-copy > span { overflow: hidden; color: #5f6368; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.ai-evidence-open { color: #5f6368; font-size: 18px; }
.ai-evidence-dialog { width: min(920px, calc(100vw - 32px)); max-height: min(90vh, 900px); padding: 0; overflow: auto; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(15,23,42,.34); }.ai-evidence-dialog::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(8px); }.ai-evidence-close { position: sticky; top: 14px; float: right; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; margin: 14px 14px -54px 0; border: 0; border-radius: 50%; color: #3c4043; background: rgba(255,255,255,.92); box-shadow: var(--shadow); cursor: pointer; }.ai-evidence-close:hover { background: #f1f3f4; }
.ai-evidence-modal-content { display: grid; }.ai-evidence-modal-content > header { display: flex; align-items: center; gap: 12px; padding: 26px 68px 20px 26px; background: #f8fbfc; }.ai-evidence-modal-content > header > .material-symbols-rounded { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #005f74; background: #e5f5f8; }.ai-evidence-modal-content > header p { margin: 0 0 3px; color: #5f6368; font-size: 12px; }.ai-evidence-modal-content > header h2 { font-size: 23px; }.ai-evidence-modal-content img { width: 100%; height: auto; border-top: 1px solid #e8eaed; border-bottom: 1px solid #e8eaed; }.ai-evidence-modal-details { display: grid; gap: 14px; padding: 22px 26px 26px; }.ai-evidence-modal-details > div { display: flex; align-items: center; gap: 8px; color: #5f6368; font-size: 14px; }.ai-evidence-modal-details > div .material-symbols-rounded { font-size: 19px; }.ai-evidence-value { margin: 0; color: #005f74; font-size: 20px; font-weight: 500; line-height: 1.3; }.ai-evidence-modal-details blockquote { margin: 0; padding: 13px 16px; border-left: 3px solid #72cbdc; border-radius: 0 10px 10px 0; color: #3c4043; background: #f8fbfc; font-size: 16px; line-height: 1.55; }
.ai-evidence-image-wrap { position: relative; display: grid; justify-items: center; background: #eef2f7; }.ai-evidence-image-wrap.is-source-page { max-height: 62vh; padding: 18px; overflow: auto; }.ai-evidence-image-wrap.is-source-page > span { position: sticky; top: 0; z-index: 1; display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 0 0 -42px 8px; padding: 8px 11px; border-radius: 999px; color: #005f74; background: rgba(255,255,255,.94); box-shadow: 0 3px 12px rgba(60,64,67,.16); font-size: 12px; font-weight: 600; }.ai-evidence-image-wrap.is-source-page > span .material-symbols-rounded { font-size: 17px; }.ai-evidence-image-wrap.is-source-page img { width: auto; max-width: 100%; border: 0; border-radius: 10px; box-shadow: 0 6px 22px rgba(60,64,67,.18); }
.ai-evidence-modal-details .ai-normalization { padding: 12px 14px; border-radius: 12px; color: #3c4043; background: #f1f3f4; line-height: 1.4; }.ai-normalization strong { color: #005f74; font-weight: 600; }
.ai-processing { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .36); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
.ai-processing.is-visible { opacity: 1; pointer-events: auto; }
.ai-processing-card { position: relative; display: grid; justify-items: center; align-items: center; width: min(100%, 500px); padding: 42px 40px 34px; overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 24px 70px rgba(15,23,42,.28); text-align: center; }
.ai-processing-card::before { content: ""; position: absolute; width: 280px; height: 280px; top: -150px; right: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(66,133,244,.26), rgba(66,133,244,0) 70%); }
.ai-orb { position: relative; width: 106px; height: 106px; margin: 0 auto 20px; border-radius: 42% 58% 51% 49% / 51% 42% 58% 49%; background: conic-gradient(from 210deg, #00b4e5, #8de8ee, #006b83, #263d49, #007d96, #00b4e5); box-shadow: 0 12px 30px rgba(66,133,244,.32); animation: ai-orb-morph 3.2s ease-in-out infinite; }
.ai-orb::after { content: ""; position: absolute; inset: 12px; border-radius: inherit; background: rgba(255,255,255,.9); }
.ai-orb span { position: absolute; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: #00b4e5; box-shadow: 0 0 14px currentColor; animation: ai-orb-dot 1.8s ease-in-out infinite; }
.ai-orb span:nth-child(1) { top: 27px; left: 31px; }.ai-orb span:nth-child(2) { top: 49px; left: 53px; animation-delay: .23s; background: #a855f7; }.ai-orb span:nth-child(3) { top: 68px; left: 35px; animation-delay: .46s; background: #34a853; }
.ai-processing-copy { position: relative; z-index: 1; display: grid; justify-items: center; width: 100%; text-align: center; }.ai-processing-copy .eyebrow { margin: 0 0 10px; color: #5f6368; font-weight: 450; letter-spacing: .01em; }.ai-processing-copy h2 { max-width: 380px; margin: 0; color: #263d49; font-size: 25px; line-height: 1.24; text-align: center; }.ai-processing-copy > p:last-child { max-width: 360px; margin: 13px auto 0; color: var(--muted); line-height: 1.55; text-align: center; }
.ai-processing-steps { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; width: 100%; gap: 8px; margin: 26px auto 0; }.ai-processing-steps span { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 6px 11px; border-radius: 15px; color: #3c4043; background: #f1f3f4; font-size: 12px; line-height: 1; white-space: nowrap; animation: ai-step 2.4s ease-in-out infinite; }.ai-processing-steps span:nth-child(2) { animation-delay: .35s; }.ai-processing-steps span:nth-child(3) { animation-delay: .7s; }
@keyframes ai-orb-morph { 0%,100% { border-radius: 42% 58% 51% 49% / 51% 42% 58% 49%; transform: rotate(0deg) scale(1); } 50% { border-radius: 62% 38% 35% 65% / 47% 64% 36% 53%; transform: rotate(180deg) scale(1.06); } }
@keyframes ai-orb-dot { 0%,100% { transform: scale(.65); opacity: .5; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes ai-step { 0%,100% { background: #f1f3f4; color: #5f6368; } 50% { background: #e5f5f8; color: #005f74; } }
@media (prefers-reduced-motion: reduce) { .ai-orb, .ai-orb span, .ai-processing-steps span { animation: none; } }
@media (max-width: 900px) { .container-review-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }.container-review-number { grid-column: 1 / -1; }.container-review-source { grid-column: 1 / -1; }.container-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .ai-review-card { padding: 19px; }.ai-review-header { grid-template-columns: auto 1fr; }.ai-review-count { grid-column: 1 / -1; justify-self: start; }.ai-review-summary { grid-template-columns: 1fr; }.ai-review-summary > div { border-right: 0; border-bottom: 1px solid #e8eaed; }.ai-review-summary > div:last-child { border-bottom: 0; }.container-review-item { grid-template-columns: 1fr; }.container-review-number, .container-review-source { grid-column: 1; }.container-section-heading { align-items: stretch; flex-direction: column; }.container-add-action { align-self: flex-start; }.container-fields-grid { grid-template-columns: 1fr; }.container-ai-source { grid-template-columns: auto minmax(0, 1fr); }.container-ai-source button { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 540px) { .ai-evidence-trigger-grid { grid-template-columns: 1fr; }.ai-evidence-modal-content > header { padding: 22px 58px 18px 18px; }.ai-evidence-modal-details { padding: 18px; }.ai-evidence-modal-details blockquote { font-size: 15px; } }
.module-tabs { display: inline-flex; gap: 4px; margin: -10px 0 22px; padding: 4px; border-radius: 24px; background: #edf5f7; }
.module-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 20px; color: #3c4043; font-size: 14px; }
.module-tabs a:hover { background: #e5f5f8; }
.module-tabs a.is-active { background: #fff; color: #005f74; box-shadow: var(--shadow); }
.module-tabs .material-symbols-rounded { font-size: 19px; }
.history-surface { display: grid; gap: 20px; padding: 24px; }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.history-toolbar h2 { font-size: 22px; }
.history-toolbar .helper-text { margin: 4px 0 0; }
.history-search { display: flex; align-items: center; gap: 8px; min-width: min(100%, 450px); padding: 4px 4px 4px 14px; border: 1px solid var(--line); border-radius: 26px; background: #fff; }
.history-search .material-symbols-rounded { color: var(--muted); font-size: 20px; }
.history-search input { min-height: 38px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.history-search input:focus { box-shadow: none; }
.history-search .secondary-action { min-height: 38px; }
.history-table-wrap { overflow: auto; max-height: 65vh; border: 1px solid var(--line); border-radius: 12px; }
.history-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; color: #3c4043; background: #f8fafd; border-bottom: 1px solid var(--line); font-weight: 500; text-align: left; white-space: nowrap; }
.history-table td { min-width: 150px; max-width: 360px; padding: 12px 14px; border-bottom: 1px solid #edf0f5; color: #3c4043; overflow-wrap: anywhere; white-space: normal; vertical-align: top; line-height: 1.5; }
.history-table th:first-child, .history-table td:first-child { position: sticky; left: 0; z-index: 2; min-width: 202px; background: #fff; box-shadow: 1px 0 0 var(--line); }
.history-table th:first-child { z-index: 3; background: #f8fafd; }
.history-table tr:hover td:first-child { background: #f8fafd; }
.history-table tr:hover td { background: #f8fafd; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.table-pagination > div { display: flex; gap: 8px; }
.is-disabled { pointer-events: none; opacity: .45; }
.card-link { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; color: #005f74; font-size: 14px; }
.card-link .material-symbols-rounded { font-size: 18px; }
/* Evita estirar celdas: un select con etiqueta (dos filas) y un boolean-field en la misma fila
   dejaban el checkbox a altura de toda la fila; alinear arriba unifica bordes y lectura. */
.form-shell .form-grid { align-items: start; }

.form-field-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.form-field-actions-stack--ruta {
  margin-top: 14px;
}

.form-field-actions-stack--bitacora {
  margin-top: 20px;
}

/* Espacio fiable entre el bloque de campos (form) y la fila de botones: el `gap` del
   flex a veces no separa bien un <form> hermano del div de acciones. */
.form-field-actions-stack .form-action-row {
  margin-top: 1.75rem;
  flex-shrink: 0;
}

.form-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Formulario compacto (p. ej. sugerir IA) al lado de botones que usan atributo `form=`. */
.form-action-row > form {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
  background: none;
}
label {
  display: grid;
  gap: 8px;
  color: #3c4043;
  font-size: 13px;
  line-height: 1.3;
}

/* Título e input en una fila, centrado en altura (p. ej. Medio de salida + select junto a boolean-field). */
label.form-label--inline-select {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
label.form-label--inline-select > span {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 1.3;
  padding-top: 0;
  padding-bottom: 0;
}
label.form-label--inline-select > select {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
}

/* Campos con [required]: clase .form-label--required añadida en site.js (asterisco) */
label.form-label--required {
  position: relative;
  padding-left: 12px;
}
label.form-label--required::before {
  content: "*";
  color: #b3261e;
  position: absolute;
  left: 0;
  top: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}
label.client-file-field.form-label--required::before {
  display: none;
}
label.client-file-field.form-label--required > strong::after {
  content: " *";
  color: #b3261e;
  font-weight: 800;
}

/* Pendiente de la puerta de avance (misma lista que la tarjeta de requisitos) — ámbar, no confundir con [required] */
label.form-label--gate-required:not(.boolean-field) {
  position: relative;
  padding-left: 12px;
}
label.form-label--gate-required:not(.boolean-field)::before {
  content: "*";
  color: #b06000;
  position: absolute;
  left: 0;
  top: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}
label.boolean-field.form-label--gate-required > span::after {
  content: " *";
  color: #b06000;
  font-weight: 700;
  font-size: 0.95em;
}

input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: white;
  color: var(--text);
  box-shadow: inset 0 0 0 1px transparent;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
input::placeholder, textarea::placeholder { color: #80868b; }
input:hover, textarea:hover { border-color: #c7d2e4; background: #fbfcff; }
select:hover {
  border-color: #c7d2e4;
  background-color: #fbfcff;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
}
input:disabled, select:disabled, textarea:disabled {
  color: #80868b;
  background: #f1f4f9;
  border-color: #e4e8f0;
  cursor: not-allowed;
}
select {
  appearance: none;
  padding-right: 44px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 52%,
    calc(100% - 16px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select:disabled { cursor: not-allowed; }
input[type="date"] {
  min-width: 0;
  color-scheme: light;
}
input[type="file"] {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 7px 10px;
  color: var(--muted);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 12px;
  padding: 0 12px;
  border: 1px solid #cbd7e8;
  border-radius: 16px;
  color: #005f74;
  background: #f8fafd;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #e5f5f8; border-color: #bdd0f6; }
textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #72cbdc;
  box-shadow: 0 0 0 3px #cce9ee, inset 0 0 0 1px #72cbdc;
  background: #fff;
}
select:focus, select:focus-visible {
  outline: none;
  border-color: #72cbdc;
  box-shadow: 0 0 0 3px #cce9ee, inset 0 0 0 1px #72cbdc;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #3c4043 50%),
    linear-gradient(135deg, #3c4043 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
}
input[type="checkbox"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  border: 1.5px solid #9aa0a6;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  accent-color: var(--blue);
  flex: 0 0 auto;
  box-shadow: none;
}
input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform .12s ease;
  clip-path: polygon(14% 44%, 0 58%, 38% 96%, 100% 21%, 86% 8%, 37% 67%);
  background: white;
}
input[type="checkbox"]:checked {
  border-color: var(--blue);
  background: var(--blue);
}
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
input[type="checkbox"]:hover { border-color: var(--blue); background: #f8fafd; }
input[type="checkbox"]:checked:hover { background: #1765cc; }
input[type="checkbox"]:focus { outline: 2px solid #cce9ee; outline-offset: 2px; box-shadow: none; }
.helper-text { margin: 0; color: var(--muted); }

.workflow {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 2px 16px;
  scroll-snap-type: x proximity;
}

.workflow-step {
  position: relative;
  display: block;
  min-width: 190px;
  max-width: 230px;
  padding: 0;
  color: #5f6368;
  line-height: 1.3;
  scroll-snap-align: start;
}
.workflow-marker {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cfd8e6;
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 390;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .08);
}
.workflow-marker .material-symbols-rounded { font-size: 17px; }
.workflow-copy {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  height: 152px;
  padding: 16px 14px 16px 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.workflow-copy small {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  font-size: 12px;
  line-height: 1.25;
  opacity: .8;
}
.workflow-copy strong {
  display: block;
  color: #3c4043;
  font-size: 15px;
  font-weight: 380;
  line-height: 1.25;
  padding-bottom: 10px;
  overflow-wrap: anywhere;
}
.workflow-state {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: end;
  min-height: 24px;
  margin-top: 0;
  padding: 0 10px;
  border-radius: 999px;
  color: #6f7782;
  background: #f1f4f9;
  font-size: 12px;
  white-space: nowrap;
}
.workflow-step.done .workflow-marker {
  border-color: #1e8e3e;
  background: #1e8e3e;
  color: #fff;
}
.workflow-step.done .workflow-copy {
  border-color: #d7eadc;
  background: #f5fbf6;
}
.workflow-step.done .workflow-copy strong { color: #188038; }
.workflow-step.done .workflow-state { color: #188038; background: #e6f4ea; }
.workflow-step.active .workflow-marker {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 5px #e5f5f8;
}
.workflow-step.active .workflow-copy {
  border-color: #b9d3ff;
  background: #f8fbfc;
  box-shadow: 0 4px 14px rgba(0, 125, 150, .12);
}
.workflow-step.active .workflow-copy strong { color: #005f74; }
.workflow-step.active .workflow-state { color: #005f74; background: #e5f5f8; }
.workflow-step.pending .workflow-marker {
  background: #f8fafd;
  color: #6f7782;
}

/* —— Expediente detalle: checklist, evidencia y bitácora —— */
#evidencia {
  margin-top: 20px;
}
.evidencia-bitacora {
  align-items: start;
  gap: 20px 18px;
}

.evidencia-checklist-surface,
.bitacora-aside {
  min-width: 0;
}

/* Panel izquierdo: anclar al borde de lectura; la lista no "flota" al centro. */
.evidencia-checklist-surface {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: start;
  gap: 0;
  padding: 24px 22px 28px;
  box-sizing: border-box;
}

.evidencia-checklist-surface .section-title {
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 14px 18px;
}

.evidencia-checklist-surface .section-title h2 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.evidencia-checklist-surface .section-title .helper-text {
  margin-top: 8px;
  line-height: 1.5;
  max-width: 42em;
}

.checklist-requisitos {
  width: 100%;
  margin: 0 0 4px;
  padding: 18px 18px 20px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 253, 0.98) 100%);
  border: 1px solid color-mix(in srgb, var(--line) 85%, #d0d4db);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(60, 64, 67, 0.05);
}

/* Subtítulo de bloque: mismo peso que h3 del sitio (font-weight: 360). */
.evidencia-checklist-surface .checklist-eyebrow {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 360;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #263d49;
  text-align: start;
  display: block;
}

.checklist { display: grid; gap: 12px; }
.evidencia-checklist-surface .checklist {
  gap: 12px;
  container-type: inline-size;
  container-name: checklist;
}

/* Fila 1: [checkbox] [título+chips en 2 col]  ·  Fila 2: observación a ancho completo, una sola columna. */
.check-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  row-gap: 0;
  column-gap: 12px;
  align-items: start;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06);
  border-left: 3px solid #dadce0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.12s ease;
  overflow: hidden;
}

.check-item__check {
  grid-row: 1;
  grid-column: 1;
  align-self: start;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 14px 0 12px 14px;
}
.check-item__body {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px 0;
  box-sizing: border-box;
}
.check-item__obs {
  grid-row: 2;
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px 14px 12px 14px;
  box-sizing: border-box;
  border-top: 1px solid #e6e8eb;
  background: #f8f9fb;
  box-shadow: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0 0 10px 10px;
}

.check-item--done {
  border-left-color: #188038;
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.35) 0%, #fff 48%);
}
.check-item--pending { border-left-color: #e37400; }
.check-item--optional { border-left-color: #5f6368; }
.check-item--locked { border-left-color: #007d96; background: #f8fbfc; }

.check-item:hover {
  border-color: color-mix(in srgb, #007d96 20%, var(--line));
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.09);
}

.evidencia-checklist-surface .check-item:hover {
  transform: translateY(-1px);
}

.evidencia-checklist-surface .check-item:focus-within {
  border-color: color-mix(in srgb, #007d96 25%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, #007d96 20%, transparent), 0 6px 20px rgba(0, 125, 150, 0.08);
}

.check-item__check input[type="checkbox"] { margin: 0; }

/* Título (col 1) y etiquetas de estado (col 2); hint debajo a ancho completo. */
.check-item__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.evidencia-checklist-surface .check-item__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 14px;
  row-gap: 6px;
  width: 100%;
}
.check-item__name {
  min-width: 0;
  line-height: 1.35;
  font-size: 15px;
  font-weight: 360;
  color: #263d49;
  overflow-wrap: anywhere;
}
.evidencia-checklist-surface .check-item__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  align-self: start;
}
.evidencia-checklist-surface .check-item .status-pill {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12.5px;
}
@container checklist (max-width: 420px) {
  .evidencia-checklist-surface .check-item__header {
    grid-template-columns: 1fr;
  }
  .evidencia-checklist-surface .check-item__pills {
    justify-content: flex-start;
  }
}
.check-item__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #5f6368;
}
.evidencia-checklist-surface .check-item--locked .check-item__hint {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #007d96 6%, #f8fbfc);
  border: 1px solid color-mix(in srgb, #007d96 12%, #e0e3e6);
  color: #3c4043;
}
.evidencia-checklist-surface .check-item--done .check-item__obs {
  background: #f1f5f1;
  border-top-color: #c8d8cb;
}
.evidencia-checklist-surface .check-item--locked .check-item__obs {
  background: #f4f7fc;
  border-top-color: #d6e0f2;
}
.check-item__obs-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #3c4043;
  line-height: 1.35;
  margin: 0;
}
.check-item__obs-input,
.check-item__obs input[type="text"] {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #d0d3d7;
  box-sizing: border-box;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.evidencia-checklist-surface .check-item__obs-input,
.evidencia-checklist-surface .check-item__obs input[type="text"] {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.check-item__obs-input:focus,
.check-item__obs input:focus {
  outline: 2px solid #c4d7fb;
  outline-offset: 0;
  border-color: #72cbdc;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 125, 150, 0.12);
}

/* Carga: bloque propio, claramente distinto al checklist, con respiro. */
.evidencia-upload {
  margin-top: 28px;
  padding: 24px 22px 28px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #007d96 20%, var(--line));
  border-top: 2px solid #007d96;
  background:
    linear-gradient(165deg, #f0f5ff 0%, #fff 35%, #fafbfc 100%);
  box-shadow: 0 2px 12px rgba(0, 125, 150, 0.07);
}
.evidencia-upload__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 2px;
}
.evidencia-upload__head > .material-symbols-rounded {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #005f74;
  background: #fff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(0, 125, 150, 0.2), 0 2px 6px rgba(0, 125, 150, 0.08);
}
.evidencia-upload__head h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 360; /* h3, como el resto de la app. */
  color: #1f1f1f;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.evidencia-upload__lede {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}
.evidencia-upload__form {
  max-width: none;
}
.evidencia-checklist-surface .evidencia-upload__form.form-shell {
  gap: 24px; /* Suma al espaciado del grid interno. */
}
.evidencia-upload__form .form-grid {
  gap: 26px 20px;
}

.evidencia-checklist-surface .evidencia-upload label {
  gap: 10px;
  line-height: 1.45;
}
.evidencia-upload .primary-action {
  margin-top: 20px;
  min-height: 44px;
  padding: 0 22px;
}

/* Bitácora: hilo, scroll suave, composición fija al pie. */
.bitacora-aside { display: flex; flex-direction: column; }
.bitacora-timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-height: min(50vh, 420px);
  padding: 2px 4px 4px 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
.bitacora-timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 10px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, #cce9ee, #e8eaed 75%);
  z-index: 0;
  pointer-events: none;
}
.bitacora-timeline .timeline-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px 12px;
  padding: 10px 0 14px;
  margin: 0;
}
.bitacora-timeline .timeline-item:last-child { padding-bottom: 4px; }
.timeline-item__node {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}
.bitacora-timeline .dot {
  width: 12px;
  height: 12px;
  margin: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #007d96;
  box-shadow: 0 0 0 1px #cce9ee, 0 1px 3px rgba(60, 64, 67, 0.16);
  flex-shrink: 0;
}
.timeline-item__content { min-width: 0; }
.timeline-item__head {
  display: flex;
  flex-direction: column;
  gap: 4px 10px;
  align-items: flex-start;
}
@media (min-width: 480px) {
  .bitacora-timeline .timeline-item__head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
  }
  .bitacora-timeline .timeline-item__time { margin-left: auto; text-align: right; }
}
/* Bitácora: título de evento, mismo peso que h3 / títulos de tarjeta (360). */
.bitacora-timeline .timeline-item__action {
  font-size: 14px;
  font-weight: 360;
  line-height: 1.35;
  color: #263d49;
}
.timeline-item__time {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}
@media (min-width: 480px) {
  .timeline-item__time { max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.timeline-item__body {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #3c4043;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bitacora-compose {
  margin-top: 4px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.bitacora-compose__label { margin: 0; }
.bitacora-compose .form-action-row { margin-top: 1.1rem; }

.boolean-field {
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: #3c4043;
}
.boolean-field span { grid-column: 2; grid-row: 1; }
.boolean-field input[type="checkbox"] { grid-column: 1; grid-row: 1; }
.boolean-field:hover { border-color: #c7d2e4; background: #fbfcff; }

.admin-card,
.role-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-card .secondary-action { justify-self: start; }

.ai-admin-panel {
  border-color: #cce9ee;
  background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
}

.ai-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(220px, .8fr);
  gap: 14px;
  align-items: center;
}

.ai-empty-state strong,
.ai-insight-card strong {
  display: block;
  font-weight: 390;
  line-height: 1.3;
}

.ai-case-panel {
  border-color: #cce9ee;
}

.ai-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ai-action-row span {
  color: var(--muted);
  line-height: 1.35;
}

.ai-empty-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafd;
}

.ai-empty-state .material-symbols-rounded {
  color: var(--muted);
}

.ai-empty-state p,
.ai-insight-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.ai-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.ai-insight-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ai-insight-card.summary,
.ai-insight-card.client-message {
  grid-column: 1 / -1;
}

.ai-insight-card .material-symbols-rounded {
  color: var(--blue);
}

.ai-insight-card ul,
.ai-insight-card ol {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.ai-insight-card li {
  margin: 6px 0;
  line-height: 1.4;
}

.ai-insight-card li span {
  display: inline-flex;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5f5f8;
  color: #005f74;
  font-size: 12px;
}

.role-matrix {
  display: grid;
  gap: 14px;
}

.role-card > div:first-child strong {
  display: block;
  font-size: 18px;
  font-weight: 380;
}

.role-card > div:first-child small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.dashboard-heading {
  margin-bottom: 22px;
}

.dashboard-metrics {
  align-items: stretch;
}

.dashboard-stat {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  overflow: hidden;
  border-color: rgba(223, 228, 236, .88);
  background:
    radial-gradient(180px circle at 96% 0%, var(--stat-glow), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .98), var(--stat-bg));
}

.dashboard-stat::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--stat-color);
}

.dashboard-stat > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--stat-color);
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stat-color) 18%, transparent);
  font-size: 22px;
}

.dashboard-stat small {
  margin: 0;
  color: #3c4043;
}

.dashboard-stat strong {
  margin-top: 5px;
  color: var(--stat-color);
}

.dashboard-stat p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.3;
}

.stat-has-popover {
  cursor: default;
  overflow: visible;
  z-index: 1;
}

.stat-has-popover:hover,
.stat-has-popover:focus-within,
.stat-has-popover:focus {
  z-index: 8;
  border-color: color-mix(in srgb, var(--stat-color) 32%, var(--line));
}

.metric-popover > strong {
  color: #263d49;
  font-size: 15px;
  font-weight: 390;
}

.metric-popover p {
  margin: 0;
  color: var(--muted);
}

.metric-ai-tip {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: var(--radius);
  color: #005f74;
  background: #e5f5f8;
  line-height: 1.35;
}

.metric-ai-tip .material-symbols-rounded {
  font-size: 18px;
  color: var(--blue);
}

.metric-popover-list {
  display: grid;
  gap: 8px;
}

.metric-popover-list a {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border-radius: var(--radius);
  background: #f8fafd;
}

.metric-popover-list a:hover,
.metric-popover-list a:focus-visible {
  background: #edf5f7;
  outline: none;
}

.metric-popover-list b {
  display: block;
  color: #263d49;
  font-weight: 390;
  line-height: 1.25;
}

.metric-popover-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
}

.stat-blue { --stat-color: #007d96; --stat-bg: #f4f9fa; --stat-glow: rgba(0, 125, 150, .18); }
.stat-red { --stat-color: #d93025; --stat-bg: #fff7f6; --stat-glow: rgba(217, 48, 37, .14); }
.stat-amber { --stat-color: #b06000; --stat-bg: #fffaf0; --stat-glow: rgba(251, 188, 4, .24); }
.stat-green { --stat-color: #188038; --stat-bg: #f5fbf6; --stat-glow: rgba(52, 168, 83, .18); }
.stat-indigo { --stat-color: #5e35b1; --stat-bg: #faf7ff; --stat-glow: rgba(94, 53, 177, .15); }

/* Expediente detalle: métricas = dashboard-stat, área = mismos tonos que “Carga por área” */
.metric.dashboard-stat.detalle-metrica--area.area-blue,
.metric.dashboard-stat.detalle-metrica--area.area-cyan,
.metric.dashboard-stat.detalle-metrica--area.area-green,
.metric.dashboard-stat.detalle-metrica--area.area-indigo,
.metric.dashboard-stat.detalle-metrica--area.area-purple,
.metric.dashboard-stat.detalle-metrica--area.area-amber,
.metric.dashboard-stat.detalle-metrica--area.area-teal,
.metric.dashboard-stat.detalle-metrica--area.area-orange,
.metric.dashboard-stat.detalle-metrica--area.area-rose,
.metric.dashboard-stat.detalle-metrica--area.area-slate {
  --stat-color: var(--area-color);
  --stat-bg: var(--area-bg);
  --stat-glow: color-mix(in srgb, var(--area-color) 20%, transparent);
}

.detalle-metrica-grid .dashboard-stat strong.detalle-metrica-strong-text {
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detalle-metrica-grid .dashboard-stat p {
  margin: 5px 0 0;
}

.dashboard-main {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: start;
  margin-top: 20px;
}

.dashboard-area-load,
.ai-dashboard-panel {
  margin-top: 20px;
}

.area-load-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.area-load-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 170px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--area-color) 22%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(180px circle at 96% 0%, color-mix(in srgb, var(--area-color) 18%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--area-bg));
  box-shadow: var(--shadow);
}

.area-load-card.is-current {
  border-color: color-mix(in srgb, var(--area-color) 48%, var(--line));
  box-shadow: 0 2px 8px rgba(60, 64, 67, .13), 0 10px 24px color-mix(in srgb, var(--area-color) 14%, transparent);
}

.area-load-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: var(--area-color);
}

.area-load-card > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--area-color);
  background: rgba(255, 255, 255, .78);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent);
  font-size: 22px;
}

.area-load-card small {
  display: block;
  color: #3c4043;
  line-height: 1.25;
}

.area-load-card strong {
  display: block;
  margin-top: 5px;
  color: var(--area-color);
  font-size: clamp(24px, 2.1vw, 30px);
  font-weight: 330;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.area-load-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.3;
}

.area-next-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 30px;
  margin-top: 12px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--area-color) 24%, var(--line));
  border-radius: 16px;
  color: var(--area-color);
  background: rgba(255, 255, 255, .72);
}

.area-next-action span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.area-next-action .material-symbols-rounded {
  font-size: 17px;
}

.area-next-action:hover,
.area-next-action:focus-visible {
  background: #fff;
  outline: none;
}

.area-role-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--area-color);
  background: rgba(255, 255, 255, .82);
  font-size: 12px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 22%, transparent);
}

.area-blue { --area-color: #007d96; --area-bg: #f4f9fa; }
.area-cyan { --area-color: #008eaa; --area-bg: #f2fbfd; }
.area-green { --area-color: #188038; --area-bg: #f4fbf5; }
.area-indigo { --area-color: #3f51b5; --area-bg: #f6f7ff; }
.area-purple { --area-color: #8e24aa; --area-bg: #fcf6ff; }
.area-amber { --area-color: #b06000; --area-bg: #fff9ec; }
.area-teal { --area-color: #00796b; --area-bg: #f1fbf9; }
.area-orange { --area-color: #e8710a; --area-bg: #fff7ef; }
.area-rose { --area-color: #c5221f; --area-bg: #fff7f7; }
.area-slate { --area-color: #5f6368; --area-bg: #f8fafd; }

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

.workload-card {
  display: grid;
  gap: 12px;
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
}

.workload-card-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.workload-card-header > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--blue);
  background: #e5f5f8;
}

.workload-card h3 {
  line-height: 1.22;
  font-weight: 360;
}

.workload-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.workload-meter {
  height: 6px;
  border-radius: 999px;
  background: #edf5f7;
  overflow: hidden;
}

.workload-meter span {
  display: block;
  height: 100%;
  min-width: 18px;
  border-radius: inherit;
  background: var(--blue);
}

.workload-tasks {
  display: grid;
  gap: 8px;
  align-self: end;
}

.workload-task,
.deadline-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #f8fafd;
}

.workload-task:hover,
.deadline-card:hover {
  border-color: #c9e3e9;
  background: #fff;
}

.workload-task strong,
.deadline-card strong {
  display: block;
  line-height: 1.3;
  font-weight: 360;
  color: #263d49;
}

.workload-task small,
.deadline-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.deadline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #9aa0a6;
}

.deadline-dot.soon { background: var(--amber); }
.deadline-dot.overdue { background: var(--red); }

.reminder-panel {
  position: sticky;
  top: 96px;
}

.deadline-list {
  display: grid;
  gap: 10px;
}

.deadline-card {
  grid-template-columns: 32px minmax(0, 1fr);
  background: #fff;
  border-color: var(--line);
}

.deadline-card > .material-symbols-rounded {
  color: var(--blue);
  margin-top: 1px;
}

.deadline-card.overdue {
  border-color: #f4c7c3;
  background: #fff8f7;
}

.deadline-card.soon {
  border-color: #fce8b2;
  background: #fffaf0;
}

.deadline-card p {
  margin: 4px 0;
  color: #3c4043;
  line-height: 1.35;
}

.empty-state {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafd;
}

.empty-state.compact {
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 12px;
}

.empty-state .material-symbols-rounded {
  color: var(--blue);
}

.empty-state strong {
  display: block;
  font-weight: 390;
}

.empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ai-dashboard-panel {
  border-color: #cce9ee;
  background: linear-gradient(180deg, rgba(255, 255, 255, .94) 0%, rgba(248, 251, 255, .94) 100%);
}

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

.area-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-picker label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafd;
  font-size: 12px;
  white-space: nowrap;
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.38; }
th { color: var(--muted); font-weight: 360; font-size: 13px; }
tr:last-child td { border-bottom: 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--muted); }
.tabs a.active { background: #e5f5f8; color: #005f74; border-color: #cce9ee; }

.alert-box {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fef7e0;
  color: #6f4200;
}
.alert-box.success {
  background: #e6f4ea;
  color: var(--green);
}
.validation-alert:empty,
.validation-summary-valid {
  display: none;
}
.validation-alert ul,
.validation-summary-errors ul {
  margin: 0;
  padding-left: 18px;
}
.validation-alert li,
.validation-summary-errors li {
  margin: 3px 0;
}

.toast-message {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  padding: 12px 16px;
  border-radius: 20px;
  background: #263d49;
  color: white;
  box-shadow: var(--shadow);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 48px auto 0;
  padding: 18px 2px 2px;
  border-top: 1px solid rgba(218, 225, 235, .86);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.app-footer div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.app-footer div:last-child {
  column-gap: 4px;
}

.app-footer strong {
  color: #3c4043;
  font-weight: 390;
}

.app-footer div:last-child {
  justify-content: flex-end;
  text-align: right;
}

.app-footer a {
  color: #005f74;
  font-weight: 390;
  border-radius: 12px;
}

.app-footer a:hover,
.app-footer a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.public-footer {
  padding-bottom: 0;
}

.public-body {
  background: transparent;
}

/* Altura aprox. barra fija: min-height + padding + safe area (sincronizar si cambia .public-top-bar) */
:root {
  --public-top-bar-occupancy: 100px;
}

.public-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-height: 76px;
  margin: 0;
  padding:
    max(10px, env(safe-area-inset-top, 0px))
    max(16px, calc(50% - 600px))
    14px
    max(16px, calc(50% - 600px));
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid rgba(223, 228, 236, 0.85);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
}

.public-top-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 0 1 auto;
}

.public-top-bar .top-ai-toggle label {
  min-height: 48px;
  padding: 5px 10px 5px 11px;
}

@media (max-width: 640px) {
  .public-top-bar .top-ai-toggle label {
    gap: 6px;
  }
}

.public-role-switcher {
  flex: 0 0 auto;
  border-radius: var(--radius);
}

.public-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--public-top-bar-occupancy) 0 56px;
}

.public-hero {
  display: grid;
  gap: 28px;
  padding: 28px 0 24px;
}

.public-brand {
  padding: 0;
  gap: 2px;
  font-size: 31px;
  line-height: 1;
  align-items: center;
}

.public-brand .brand-mark,
.public-brand .brand-mark img {
  width: 54px;
  height: 54px;
}

.public-brand .brand-mark {
  flex-basis: 54px;
}

.public-hero p {
  margin: 0 0 4px;
  color: var(--muted);
}

.public-hero h1 {
  margin-bottom: 12px;
}

.public-hero span {
  display: block;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.public-card {
  max-width: 980px;
}

.public-metrics {
  margin-top: 8px;
}

.client-doc-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.client-doc-row .material-symbols-rounded {
  color: #9aa0a6;
}

.client-doc-row .ok-icon {
  color: var(--green);
}

.client-doc-row strong {
  display: block;
  font-weight: 360;
}

.client-doc-row small {
  color: var(--muted);
}

.client-portal-ai-guide {
  margin-top: 28px;
  margin-bottom: 40px;
  border: 1px solid rgba(0, 125, 150, 0.22);
  background: linear-gradient(135deg, rgba(0, 125, 150, 0.07), rgba(255, 255, 255, 0.92));
}

.client-portal-ai-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.client-portal-ai-list li + li {
  margin-top: 0.45rem;
}

.client-portal-hero {
  display: grid;
  gap: 34px;
  padding: 24px 0 30px;
}

.client-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 28px;
  align-items: end;
}

.client-hero-copy {
  max-width: 760px;
}

.client-hero-copy p {
  margin: 0 0 6px;
  color: var(--muted);
}

.client-hero-copy h1 {
  max-width: 780px;
}

.client-hero-copy span {
  display: block;
  max-width: 720px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.client-hero-panel,
.client-help-card,
.client-progress-card,
.client-confirmation {
  border: 1px solid rgba(210, 227, 252, .9);
  border-radius: var(--radius);
  background:
    radial-gradient(520px circle at 100% 0%, rgba(0, 125, 150, .16), transparent 64%),
    rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.client-hero-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.client-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .66);
}

.client-step > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #5f6368;
  background: #f1f4f9;
}

.client-step.active > span {
  color: #fff;
  background: var(--blue);
}

.client-step strong {
  display: block;
  line-height: 1.25;
  font-weight: 360;
}

.client-step small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.client-intake-layout,
.client-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.client-intake-layout {
  margin-top: 24px;
}

.client-upload-layout {
  margin-top: 20px;
}

.client-intake-card,
.client-documents-card,
.client-upload-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
}

.client-help-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.client-help-card > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--blue);
  background: #e5f5f8;
}

.client-help-card p {
  margin: 0;
  color: var(--muted);
}

.client-help-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.client-help-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3c4043;
}

.client-help-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.client-main-action {
  justify-self: start;
  min-width: 220px;
}

.client-case-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 24px;
  margin-bottom: 20px;
}

/* La guía ya deja margen inferior; no duplicar con margin-top. */
section.client-portal-ai-guide + section.client-case-summary {
  margin-top: 0;
}

.client-progress-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
}

.client-progress-card .material-symbols-rounded {
  color: var(--blue);
}

.client-progress-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.client-progress-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.client-progress-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 58%, transparent 59%),
    conic-gradient(var(--blue) calc(var(--progress) * 1%), #e8eef7 0);
}

.client-progress-ring strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 380;
}

.client-progress-ring span {
  color: var(--muted);
  font-size: 12px;
}

.client-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.client-summary-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow);
}

.client-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.client-summary-grid strong {
  display: block;
  margin-top: 4px;
  line-height: 1.3;
  font-weight: 360;
}

.client-progress-line {
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #edf5f7;
  overflow: hidden;
}

.client-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.client-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-doc-row.done {
  border-color: #d7eadc;
  background: #f5fbf6;
}

.client-file-field {
  position: relative;
  grid-column: 1 / -1;
  min-height: 128px;
  padding: 18px;
  border: 1.5px dashed #b9d3ff;
  border-radius: var(--radius);
  background: #f8fbfc;
}

.client-file-field > .material-symbols-rounded {
  color: var(--blue);
}

.client-file-field strong {
  display: block;
  font-weight: 360;
}
.client-file-field small {
  display: block;
}

.client-file-field small {
  color: var(--muted);
}

.client-file-field input[type="file"] {
  margin-top: 10px;
  background: #fff;
}

.client-confirmation {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 20px;
  padding: 18px;
}

.client-confirmation .material-symbols-rounded {
  color: var(--green);
}

.client-confirmation strong {
  display: block;
  font-weight: 360;
}

.client-confirmation p {
  margin: 4px 0 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .menu-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #3c4043;
    background: transparent;
    cursor: pointer;
  }
  .menu-button:hover,
  .menu-button:focus-visible {
    background: #e5f5f8;
    color: #005f74;
    outline: none;
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    display: block;
    background: rgba(32, 33, 36, .26);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(304px, calc(100vw - 48px));
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 12px 28px rgba(60, 64, 67, .22);
    transform: translateX(-104%);
    transition: transform .22s ease;
  }
  .nav-open .side-nav { transform: translateX(0); }
  .side-nav nav { grid-template-columns: 1fr; }
  .top-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 14px;
  }
  .top-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }
  .top-ai-toggle label {
    min-height: 48px;
  }
  .profile-pill {
    min-width: min(230px, 100%);
  }
  .role-switcher {
    grid-template-columns: 22px minmax(112px, 1fr);
    flex: 1 1 180px;
  }
  .public-top-bar {
    min-height: auto;
    align-items: stretch;
    flex-wrap: wrap;
    padding: max(8px, env(safe-area-inset-top, 0px)) 16px 12px 16px;
  }
  .public-brand {
    flex: 1 1 180px;
    font-size: 28px;
  }
  .public-brand .brand-mark,
  .public-brand .brand-mark img {
    width: 48px;
    height: 48px;
  }
  .public-brand .brand-mark {
    flex-basis: 48px;
  }
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .app-footer div:last-child {
    justify-content: flex-start;
    text-align: left;
  }
  .page-content { padding: 12px 18px 36px; }
  .grid.metrics, .grid.two, .grid.three, .form-grid, .dashboard-main, .role-workload-grid, .ai-dashboard-grid, .area-load-grid { grid-template-columns: 1fr; }
  .registration-hero { grid-template-columns: auto 1fr; }
  .registration-hero-status { grid-column: 1 / -1; justify-self: start; }
  .registration-section { padding: 0 16px 20px; }
  .registration-section::before { margin: 0 -16px; }
  .registration-section-header { grid-template-columns: auto 1fr; }
  .registration-section-count { grid-column: 2; justify-self: start; }
  .registration-accordion .registration-section-header { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 92px; padding: 17px 16px; gap: 11px; }
  .registration-accordion .registration-section-progress { grid-column: 2; justify-self: start; }
  .registration-accordion .section-chevron { grid-column: 3; grid-row: 1 / span 2; }
  .registration-accordion-content { padding: 4px 16px 22px; }
  .capture-order-heading { align-items: start; flex-direction: column; gap: 3px; }
  .capture-order-track { grid-template-columns: 1fr; }
  .capture-order-step { min-height: 54px; }
  .registration-accordion .registration-section-header { padding: 14px; }
  .registration-section-progress { min-width: 0; }
  .registration-actions { align-items: stretch; flex-direction: column; }
  .registration-actions .primary-action { width: 100%; }
  .case-row { grid-template-columns: 1fr; }
  .reminder-panel { position: static; }
  .check-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .evidencia-checklist-surface .check-item__obs {
    padding: 10px 12px 12px 12px;
  }
  .admin-card { grid-template-columns: 1fr; }
  .public-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 92px;
  }
  .client-hero-grid,
  .client-intake-layout,
  .client-upload-layout,
  .client-case-summary,
  .client-doc-grid {
    grid-template-columns: 1fr;
  }
  .client-progress-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .client-progress-ring {
    width: 112px;
    height: 112px;
    flex-basis: 112px;
  }
  .client-main-action {
    width: 100%;
  }

  .reportes-main-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Reportes operativos —— */
.reportes-heading .reportes-heading-lead {
  display: block;
  margin-top: 10px;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* Reportes KPI: 4 columnas en escritorio, mismas alturas; responsive abajo (tras cascada base). */
.grid.metrics.reportes-kpi {
  align-items: stretch;
  gap: 14px;
}

@media (min-width: 981px) {
  .grid.metrics.reportes-kpi {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid.metrics.reportes-kpi .dashboard-stat {
    min-height: 140px;
    height: 100%;
    box-sizing: border-box;
  }
}

.reportes-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
}

.reportes-bar-list {
  display: grid;
  gap: 12px;
}

.reportes-bar-item {
  display: grid;
  gap: 6px;
}

.reportes-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #3c4043;
}

.reportes-bar-label strong {
  font-size: 14px;
  font-weight: 330;
  color: #263d49;
  font-variant-numeric: tabular-nums;
}

/* Barras de reportes: relleno plano (sin gradiente), carril neutro. */
.reportes-bar-track {
  height: 9px;
  border-radius: 999px;
  background: #eceff1;
  box-shadow: inset 0 0 0 1px rgba(60, 64, 67, 0.08);
  overflow: hidden;
}

.reportes-bar-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #007d96;
  min-width: 2px;
  transition: width 0.2s ease, background-color 0.15s ease;
}

/* Mismas tonalidades planas que .area-* (site.css) para coherencia con el resto de la UI. */
.reportes-bar-track--area.area-blue > span { background: #007d96; }
.reportes-bar-track--area.area-cyan > span { background: #008eaa; }
.reportes-bar-track--area.area-green > span { background: #188038; }
.reportes-bar-track--area.area-indigo > span { background: #3f51b5; }
.reportes-bar-track--area.area-purple > span { background: #8e24aa; }
.reportes-bar-track--area.area-amber > span { background: #b06000; }
.reportes-bar-track--area.area-teal > span { background: #00796b; }
.reportes-bar-track--area.area-orange > span { background: #e8710a; }
.reportes-bar-track--area.area-rose > span { background: #c5221f; }
.reportes-bar-track--area.area-slate > span { background: #5f6368; }

.reportes-area-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

/* Misma familia que .dashboard-stat: icono 42px, resplandor, barra 4px; cifra en acento, algo menor que el KPI principal. */
.reportes-area-chip {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  min-height: 120px;
  height: 100%;
  padding: 16px 18px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--area-color) 22%, var(--line));
  background:
    radial-gradient(180px circle at 96% 0%, color-mix(in srgb, var(--area-color) 18%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--area-bg));
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.reportes-area-chip::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: var(--area-color);
}

.reportes-area-chip .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--area-color);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent);
  font-size: 22px;
}

.reportes-area-chip small {
  display: block;
  margin: 0;
  color: #3c4043;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
}

.reportes-area-chip strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 330;
  line-height: 1.1;
  color: var(--area-color);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Popovers en chips de carga por área (mismo patrón que tablero). */
.reportes-area-chip.stat-has-popover {
  position: relative;
  cursor: default;
  --stat-color: var(--area-color);
  /* Sin esto, overflow:hidden de .reportes-area-chip recorta el popover (position: absolute, debajo de la tarjeta). */
  overflow: visible;
  /* +8px bajo el contenido (16+8) para no perder :hover al ir al popover, sin dejar hueco con top:100%. */
  padding-bottom: 24px;
}

/* Encima del chip + padding, sin hueco que rompa :hover. */
.reportes-area-chip .metric-popover {
  top: 100%;
}

.reportes-area-chip.stat-has-popover:hover,
.reportes-area-chip.stat-has-popover:focus-within,
.reportes-area-chip.stat-has-popover:focus {
  z-index: 8;
  border-color: color-mix(in srgb, var(--area-color) 38%, var(--line));
}

.metric-popover .helper-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Reportes: popover "carga por área" con datos compactos, sin alargar el layout. */
.metric-popover--area .metric-popover-facts {
  margin: 6px 0 0;
  padding: 0;
  line-height: 1.4;
  font-size: 12px;
  color: #3c4043;
  display: grid;
  gap: 4px 0;
}

.metric-popover--area .metric-popover-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.metric-popover--area .metric-popover-fact span {
  color: var(--muted);
  font-weight: 400;
  min-width: 0;
}

.metric-popover--area .metric-popover-fact b {
  flex: 0 0 auto;
  font-weight: 390;
  color: #263d49;
  font-variant-numeric: tabular-nums;
}

.metric-popover--area .metric-popover-fact b.is-warn {
  color: #b06000;
}

.metric-popover--area .metric-popover-fact b.is-urgent {
  color: #c5221f;
}

.metric-popover--area .metric-popover-list {
  max-height: min(220px, 36vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

@media (max-width: 980px) {
  .grid.metrics.reportes-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.metrics.reportes-kpi .dashboard-stat {
    min-height: 132px;
    height: 100%;
    box-sizing: border-box;
  }

  .reportes-area-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid.metrics.reportes-kpi {
    grid-template-columns: 1fr;
  }

  .reportes-area-cards {
    grid-template-columns: 1fr;
  }
}

.reportes-spotlight-list {
  display: grid;
  gap: 10px;
}

.reportes-spotlight-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--area-color) 20%, var(--line));
  text-decoration: none;
  color: inherit;
  background:
    radial-gradient(200px circle at 100% 0%, color-mix(in srgb, var(--area-color) 14%, transparent), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .99), var(--area-bg));
  box-shadow: var(--shadow);
  transition: border-color .14s ease, box-shadow .14s ease, transform .1s ease;
}

.reportes-spotlight-card:hover,
.reportes-spotlight-card:focus-visible {
  border-color: color-mix(in srgb, var(--area-color) 40%, var(--line));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--area-color) 12%, transparent);
  transform: translateY(-1px);
  outline: none;
}

.reportes-spotlight-card .material-symbols-rounded {
  color: var(--area-color);
  font-size: 26px;
}

.reportes-spotlight-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.reportes-spotlight-main strong {
  font-size: 15px;
  font-weight: 390;
  color: #263d49;
}

.reportes-spotlight-main span {
  font-size: 13px;
  color: #3c4043;
}

.reportes-spotlight-main small {
  font-size: 12px;
  color: var(--muted);
}

.reportes-ai-panel {
  margin-top: 20px;
}

/* —— Detalle: panel lateral de documento (documentos, movimientos y eventos) —— */
.expediente-doc-table-wrap .expediente-doc-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.expediente-doc-table-wrap .expediente-doc-row:hover,
.expediente-doc-table-wrap .expediente-doc-row:focus-visible {
  background: #f1f3f4;
  outline: none;
}

.td-doc-hint {
  width: 40px;
  text-align: end;
  color: var(--muted);
}

.expediente-doc-chevron {
  font-size: 20px;
  transform: scaleX(-1);
  opacity: 0.75;
}

.table-row-muted td {
  color: #5f6368;
  font-size: 13px;
}

.expediente-doc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(32, 33, 36, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.expediente-doc-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.expediente-doc-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(60, 64, 67, 0.18);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overflow: hidden;
}

.expediente-doc-panel.is-open {
  transform: translateX(0);
}

.expediente-doc-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.expediente-doc-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 360;
  line-height: 1.2;
  word-break: break-word;
}

.expediente-doc-panel-kicker {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.expediente-doc-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  justify-content: flex-end;
}

.expediente-doc-panel-toolbar .icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: #005f74;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.expediente-doc-panel-toolbar .icon-link:hover,
.expediente-doc-panel-toolbar .icon-link:focus-visible {
  background: #e5f5f8;
  border-color: #72cbdc;
  outline: none;
}

.expediente-doc-panel-toolbar .icon-link .material-symbols-rounded {
  font-size: 20px;
}

.expediente-doc-panel-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.expediente-doc-dl {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.expediente-doc-dl > div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f3f4;
}

.expediente-doc-dl > div:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.expediente-doc-dl dt {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.expediente-doc-dl dd {
  margin: 0;
  font-size: 14px;
  color: #3c4043;
  line-height: 1.4;
  word-break: break-word;
}

.expediente-doc-ai {
  margin-top: 8px;
  padding: 14px 14px 16px;
  border: 1px solid #c9e3e9;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbfc, #f4f9fa);
}

.expediente-doc-ai-resume {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #3c4043;
}

.expediente-doc-ai h4 {
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 390;
  color: #007d96;
}

.expediente-doc-ai-list {
  margin: 0 0 6px 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #3c4043;
}

.expediente-doc-ai-list .empty-li {
  list-style: none;
  margin-left: -18px;
  color: var(--muted);
}

.expediente-doc-ai-load,
.expediente-doc-ai-err {
  font-size: 14px;
  color: #3c4043;
  display: flex;
  align-items: center;
  gap: 8px;
}

.expediente-doc-ai-err {
  color: #b06000;
}

.expediente-doc-ai-load .material-symbols-rounded.spin {
  font-size: 22px;
  animation: ateros-doc-spin 0.9s linear infinite;
}

@keyframes ateros-doc-spin {
  to {
    transform: rotate(360deg);
  }
}
