/* Layout: menú lateral fijo y ocultable + encabezado pegajoso + contenido en tarjetas Metronic.
   Los colores de componentes vienen de Metronic (data-bs-theme); estos tokens cubren el armazón. */
:root {
  --g-bg: #F9F7F7;
  --g-surface: #ffffff;
  --g-border: #ECEAEA;
  --g-text: #252F4A;
  --g-muted: #78829D;
  --g-accent: #17C653;
  --g-accent-soft: #DFFFEA;
  --g-side-bg: #12141A;
  --g-side-text: #9A9CAE;
  --g-side-active: #ffffff;
  --g-side-hover: #1E2129;
  --g-map-land: #EEF1EC;
  --g-map-road: #D7DCD3;
  --g-map-river: #BFD8EE;
  --g-font: 'Inter', Helvetica, Arial, sans-serif;
  --g-side-w: 264px;
  --g-side-min: 76px;
  --g-head-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-bg: #0F1014; --g-surface: #15171C; --g-border: #26272F; --g-text: #F5F5F5; --g-muted: #808290;
    --g-accent: #00A261; --g-accent-soft: #1F212A; --g-side-bg: #0B0C10; --g-side-text: #808290; --g-side-active: #ffffff; --g-side-hover: #1B1C22;
    --g-map-land: #1B1D22; --g-map-road: #2C2F37; --g-map-river: #1D3347; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --g-bg: #0F1014; --g-surface: #15171C; --g-border: #26272F; --g-text: #F5F5F5; --g-muted: #808290;
  --g-accent: #00A261; --g-accent-soft: #1F212A; --g-side-bg: #0B0C10; --g-side-text: #808290; --g-side-active: #ffffff; --g-side-hover: #1B1C22;
  --g-map-land: #1B1D22; --g-map-road: #2C2F37; --g-map-river: #1D3347; color-scheme: dark;
}

html, body { background: var(--g-bg); color: var(--g-text); font-family: var(--g-font); }
body { font-size: 13px; }
.ms { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle; }
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.tabular, td, .num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }

/* ---------- Armazón ---------- */
.g-shell { min-height: 100%; }
.g-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--g-side-w); background: var(--g-side-bg); color: var(--g-side-text);
  display: flex; flex-direction: column; z-index: 1040; transition: width .2s ease, transform .2s ease;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px);
}
.g-brand { height: var(--g-head-h); display: flex; align-items: center; gap: 10px; padding: 0 22px; border-bottom: 1px dashed rgba(255,255,255,.08); flex-shrink: 0; }
.g-logo { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; }
.g-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.g-brand-name { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .04em; line-height: 1.1; white-space: nowrap; }
.g-brand-sub { font-size: 10.5px; color: var(--g-side-text); letter-spacing: .02em; white-space: nowrap; }
.g-nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; }
.g-nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5E6278; padding: 16px 12px 6px; white-space: nowrap; }
.g-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--g-side-text); text-decoration: none; font-weight: 500; font-size: 13.5px; white-space: nowrap; margin-bottom: 2px; }
.g-nav a:hover { background: var(--g-side-hover); color: #fff; }
.g-nav a.active { background: var(--g-side-hover); color: var(--g-side-active); }
.g-nav a.active .ms { color: var(--g-brand, var(--g-accent)); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.g-nav a .badge { margin-left: auto; }
.g-side-foot { padding: 14px 16px; border-top: 1px dashed rgba(255,255,255,.08); font-size: 11.5px; white-space: nowrap; overflow: hidden; }

.g-main { margin-left: var(--g-side-w); transition: margin-left .2s ease; min-width: 0; }
.g-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 1030; height: var(--g-head-h); background: var(--g-surface); border-bottom: 1px solid var(--g-border);
  display: flex; align-items: center; gap: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--g-surface); }
.g-icon-btn { width: 38px; height: 38px; border-radius: 8px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--g-muted); flex-shrink: 0; }
.g-icon-btn:hover { background: var(--g-bg); color: var(--g-text); }
.g-head-title { min-width: 0; flex: 1; }
.g-head-title h1 { font-size: 16px; font-weight: 600; margin: 0; color: var(--g-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-crumbs { font-size: 11.5px; color: var(--g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-crumbs a { color: var(--g-muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--g-accent); }
.g-role-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--g-border); background: var(--g-surface); border-radius: 10px; padding: 5px 10px 5px 5px; color: var(--g-text); }
.g-role-btn:hover { border-color: var(--g-accent); }
.g-avatar { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; flex-shrink: 0; }
.g-role-meta { text-align: left; line-height: 1.15; }
.g-role-meta b { font-size: 12.5px; font-weight: 600; display: block; }
.g-role-meta span { font-size: 11px; color: var(--g-muted); }
.g-content { padding-block: 24px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1440px; }
@media (min-width: 992px) { .g-content { padding-left: 30px; padding-right: 30px; } }
.g-demo-banner { font-size: 11.5px; background: var(--g-accent-soft); color: var(--g-text); border-bottom: 1px solid var(--g-border); padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; gap: 8px; align-items: center; }

/* Menú minimizado (escritorio) */
body.g-min .g-sidebar { width: var(--g-side-min); }
body.g-min .g-main { margin-left: var(--g-side-min); }
body.g-min .g-brand-text, body.g-min .g-nav a span.lbl, body.g-min .g-nav a .badge, body.g-min .g-nav-sec, body.g-min .g-side-foot { display: none; }
body.g-min .g-brand { padding: 0 18px; }
body.g-min .g-nav a { justify-content: center; padding: 10px 0; }
body.g-min .g-nav-sep { display: block; height: 1px; margin: 10px 8px; background: rgba(255,255,255,.08); }
.g-nav-sep { display: none; }

/* Móvil: el menú es un panel deslizable */
.g-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; display: none; }
@media (max-width: 991.98px) {
  .g-sidebar { transform: translateX(-100%); width: min(280px, 86vw); }
  .g-main, body.g-min .g-main { margin-left: 0; }
  body.g-open .g-sidebar { transform: none; }
  body.g-open .g-overlay { display: block; }
  body.g-min .g-sidebar { width: min(280px, 86vw); }
  body.g-min .g-brand-text, body.g-min .g-nav a span.lbl, body.g-min .g-nav-sec, body.g-min .g-side-foot { display: revert; }
  body.g-min .g-nav a { justify-content: flex-start; padding: 9px 12px; }
  .g-role-meta { display: none; }
}

/* ---------- Componentes propios ---------- */
.g-toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.g-toast { background: var(--g-text); color: var(--g-surface); border-radius: 10px; padding: 11px 16px; font-weight: 500; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: gIn .2s ease; }
.g-toast .ms { color: var(--g-accent); }
@keyframes gIn { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .g-toast, .g-sidebar, .g-main { animation: none; transition: none; } }

.g-kpi { display: flex; gap: 14px; align-items: center; }
.g-kpi-ico { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.g-kpi-val { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--g-text); font-variant-numeric: tabular-nums; }
.g-kpi-lbl { color: var(--g-muted); font-size: 12px; font-weight: 500; }
.g-grid { display: grid; gap: 20px; }
.g-grid > * { min-width: 0; }
.g-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-cols-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1199.98px) { .g-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-cols-2-1, .g-cols-1-2, .g-cols-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575.98px) { .g-cols-4, .g-cols-2 { grid-template-columns: minmax(0, 1fr); } }
.card { border: 1px solid var(--g-border); box-shadow: none; }
.card .card-header { min-height: 60px; }
.card-title h3, .card-title .h3 { font-size: 15px; font-weight: 600; margin: 0; }
.card-sub { font-size: 12px; color: var(--g-muted); font-weight: 400; margin-top: 2px; }
.g-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.g-toolbar .g-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-search { position: relative; }
.g-search .ms { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--g-muted); font-size: 18px; }
.g-search input { padding-left: 36px; min-width: 0; width: 240px; max-width: 100%; }
@media (max-width: 575.98px) { .g-search, .g-search input { width: 100%; } .g-toolbar .g-filters { width: 100%; } }

.g-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.g-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-asignada { background: var(--bs-gray-200); color: var(--bs-gray-700); }
.st-en-proceso { background: var(--bs-warning-light); color: var(--bs-warning); }
.st-completada { background: var(--bs-info-light); color: var(--bs-info); }
.st-finalizada { background: var(--bs-success-light); color: var(--bs-success); }
.st-evaluada { background: var(--bs-primary-light); color: var(--bs-primary); }
.st-apto { background: var(--bs-primary-light); color: var(--bs-primary); }
.st-no-apto { background: var(--bs-danger-light); color: var(--bs-danger); }
.st-sin-asignar { background: var(--bs-danger-light); color: var(--bs-danger); }

.g-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.g-person .g-avatar { width: 36px; height: 36px; border-radius: 50%; }
.g-person b { display: block; font-weight: 600; color: var(--g-text); white-space: nowrap; }
.g-person small { color: var(--g-muted); font-size: 11.5px; white-space: nowrap; }
.g-link { color: var(--g-text); text-decoration: none; cursor: pointer; }
.g-link:hover { color: var(--bs-primary); }
table.dataTable td, table.table td { vertical-align: middle; }
.table > :not(caption) > * > * { padding-top: .7rem; padding-bottom: .7rem; }
.table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--g-muted); font-weight: 600; white-space: nowrap; }
.table-responsive { overflow-x: auto; }
div.dt-container .dt-search, div.dt-container .dt-length { display: none; }
div.dt-container .dt-info { font-size: 12px; color: var(--g-muted); padding-top: 12px; }
div.dt-container .dt-paging { padding-top: 8px; }
div.dt-container .dt-paging .pagination { flex-wrap: wrap; }
.g-progress { height: 6px; border-radius: 6px; background: var(--bs-gray-200); overflow: hidden; min-width: 70px; }
.g-progress > div { height: 100%; background: var(--bs-primary); border-radius: 6px; }

.g-dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 16px; font-size: 13px; }
.g-dl dt { color: var(--g-muted); font-weight: 500; }
.g-dl dd { margin: 0; color: var(--g-text); font-weight: 500; overflow-wrap: anywhere; }
.g-note { font-size: 12px; color: var(--g-muted); display: flex; gap: 6px; align-items: flex-start; }
.g-note .ms { font-size: 16px; }
.g-empty { text-align: center; color: var(--g-muted); padding: 40px 16px; }
.g-empty .ms { font-size: 40px; display: block; margin: 0 auto 8px; }

/* Mapa esquemático */
.g-map { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: var(--g-map-land); border: 1px solid var(--g-border); }
.g-map svg { display: block; width: 100%; height: auto; }
.g-map .pin { cursor: pointer; }
.g-map .pin:hover circle, .g-map .pin:hover rect, .g-map .pin.sel circle, .g-map .pin.sel rect { stroke: var(--g-text); }
.g-map path:hover { fill: var(--g-accent-soft); }
.g-map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--g-muted); padding: 10px 12px; border-top: 1px solid var(--g-border); background: var(--g-surface); }
.g-map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Acceso */
.g-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--g-surface); }
.g-auth-art { background: var(--g-side-bg); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.g-auth-art h2 { color: #fff; font-size: 30px; font-weight: 700; line-height: 1.2; text-wrap: balance; max-width: 18ch; }
.g-auth-art p { color: #A1A5B7; font-size: 14px; max-width: 46ch; }
.g-auth-flow { display: flex; flex-wrap: wrap; gap: 8px; }
.g-auth-flow span { border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: #D8D8E5; }
.g-auth-form { display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.g-auth-form form { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) { .g-auth { grid-template-columns: minmax(0, 1fr); } .g-auth-art { padding: 28px max(16px, env(safe-area-inset-left, 0px)); } .g-auth-art h2 { font-size: 22px; } }

/* Kanban de seguimiento */
.g-kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.g-kcol { background: var(--g-bg); border: 1px solid var(--g-border); border-radius: 12px; padding: 12px; min-width: 0; }
.g-kcol h4 { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--g-text); }
.g-kcard { background: var(--g-surface); border: 1px solid var(--g-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.g-kcard:hover { border-color: var(--bs-primary); }
.g-kcard b { font-size: 12.5px; display: block; color: var(--g-text); }
.g-kcard small { color: var(--g-muted); font-size: 11px; display: block; }

/* Estudio por etapas (vista de celular) */
.g-phone-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.g-phone { width: 390px; max-width: 100%; background: var(--g-surface); border: 1px solid var(--g-border); border-radius: 26px; overflow: hidden; box-shadow: 0 12px 40px rgba(20, 20, 40, .08); flex-shrink: 0; }
.g-phone-top { background: var(--g-side-bg); color: #fff; padding: 14px 18px 16px; }
.g-phone-top small { color: #A1A5B7; }
.g-phone-body { padding: 18px; min-height: 420px; }
.g-phone-foot { display: flex; gap: 10px; padding: 12px 18px 18px; border-top: 1px solid var(--g-border); }
.g-steps { display: flex; gap: 4px; margin-top: 12px; }
.g-steps i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.16); }
.g-steps i.done { background: var(--g-accent); }
.g-steps i.cur { background: #fff; }
.g-side-steps { flex: 1; min-width: 260px; }
.g-side-steps ol { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.g-side-steps li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--g-muted); font-weight: 500; }
.g-side-steps li:hover { background: var(--g-bg); }
.g-side-steps li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; border: 1px solid var(--g-border); flex-shrink: 0; }
.g-side-steps li.done { color: var(--g-text); }
.g-side-steps li.done .n { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.g-side-steps li.cur { color: var(--g-text); background: var(--g-bg); }
.g-side-steps li.cur .n { border-color: var(--bs-primary); color: var(--bs-primary); }
.g-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-photo { aspect-ratio: 1; max-width: 100%; border-radius: 8px; border: 1px dashed var(--g-border); display: grid; place-items: center; color: var(--g-muted); font-size: 10.5px; text-align: center; overflow: hidden; position: relative; cursor: pointer; background: var(--g-bg); }
.g-photo img { width: 100%; height: 100%; object-fit: cover; }
.g-photo.has { border-style: solid; }
.g-sign { width: 100%; height: 150px; border: 1px dashed var(--g-border); border-radius: 10px; background: var(--g-bg); touch-action: none; display: block; }
.g-doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--g-border); }
.g-doc-row:last-child { border-bottom: 0; }

/* Reporte imprimible */
.g-report { overflow-x: auto; background: #fff; color: #1d1d1d; max-width: 820px; margin: 0 auto; border: 1px solid var(--g-border); border-radius: 6px; padding: 40px 44px; font-size: 12px; }
.g-report h2 { font-size: 18px; letter-spacing: .08em; margin: 0; color: #1d1d1d; }
.g-report h3 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; background: #EEF0F3; color: #1d1d1d; padding: 6px 10px; margin: 22px 0 10px; }
.g-report table { width: 100%; border-collapse: collapse; }
.g-report td, .g-report th { border: 1px solid #D5D8DD; padding: 5px 8px; color: #1d1d1d; text-align: left; vertical-align: top; }
.g-report th { background: #F6F7F9; font-weight: 600; width: 28%; }
.g-report .verdict { border: 2px solid #17C653; color: #0d7a35; font-weight: 700; padding: 10px 16px; display: inline-block; letter-spacing: .06em; }
.g-report .verdict.no { border-color: #E42855; color: #b0163c; }
.g-report .ph { aspect-ratio: 4/3; background: #EEF0F3; display: grid; place-items: center; color: #6b7280; font-size: 11px; }
@media (max-width: 575.98px) { .g-report { padding: 22px 16px; } }

.g-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--g-surface); box-shadow: 0 0 0 1px var(--g-border); cursor: pointer; padding: 0; }
.g-swatch.sel { box-shadow: 0 0 0 2px var(--g-text); }
.form-label { font-weight: 500; font-size: 12.5px; }
.g-req::after { content: " *"; color: var(--bs-danger); }
.g-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; background: var(--g-bg); border: 1px solid var(--g-border); font-size: 11.5px; color: var(--g-text); margin: 0 4px 4px 0; }
.g-import-drop { border: 2px dashed var(--g-border); border-radius: 12px; padding: 32px 16px; text-align: center; color: var(--g-muted); cursor: pointer; }
.g-import-drop:hover { border-color: var(--bs-primary); color: var(--g-text); }
.g-row-err td { background: var(--bs-danger-light) !important; }
.modal-content { background: var(--g-surface); }
.g-row-sep { border-bottom: 1px dashed var(--g-border); }
.g-row-sep:last-child { border-bottom: 0; }

/* Campana de notificaciones */
.g-notif-n { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bs-danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.g-notif-menu { width: min(360px, calc(100vw - 24px)); }
.g-notif-lista { max-height: min(420px, 60vh); overflow-y: auto; }
.g-notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px dashed var(--g-border); color: var(--g-text); }
.g-notif-item:hover { background: var(--g-bg); color: var(--g-text); }
.g-notif-item .ms { color: var(--g-muted); }
.g-notif-item.nueva .ms { color: var(--bs-primary); }
.g-notif-item b { display: block; font-size: 12.5px; font-weight: 600; }
.g-notif-item.nueva b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bs-primary); margin-left: 6px; vertical-align: middle; }
.g-notif-item small { display: block; color: var(--g-muted); font-size: 11.5px; }

/* Captura del estudio */
.g-sync { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; }
.g-sync .ms { font-size: 18px; }
.g-sync.espera { background: rgba(246,192,0,.22); }
.g-sync.mal { background: rgba(248,40,90,.3); }
.g-sync a { color: #fff; text-decoration: underline; }
.g-photo-l { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 4px; font-size: 10.5px; line-height: 1.2; background: rgba(255,255,255,.85); color: #252F4A; }
.g-photo .ms { font-size: 26px; margin-bottom: 14px; }
.g-doc-thumb img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; display: block; }
.g-sign-img { display: grid; place-items: center; background: #fff; }
.g-sign-img img { max-width: 100%; max-height: 100%; }
.g-aviso-txt { background: var(--g-bg); border-radius: 8px; padding: 10px 12px; }
.g-aviso-txt summary { cursor: pointer; font-size: 13px; }
#es-lista li[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
/* En el celular la captura ocupa todo el ancho, sin el marco de teléfono. */
@media (max-width: 575.98px) {
  .g-phone-wrap { gap: 16px; }
  .g-phone { border-radius: 14px; box-shadow: none; }
  .g-phone-body { padding: 16px 14px; min-height: 0; }
  .g-phone-foot { position: sticky; bottom: 0; background: var(--g-surface); padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
  .g-side-steps { min-width: 0; width: 100%; }
}

/* Revisión */
.g-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.g-timeline li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--g-border); color: var(--g-muted); min-width: 0; }
.g-timeline li b { display: block; font-size: 12.5px; font-weight: 600; }
.g-timeline li small { display: block; font-size: 11px; color: var(--g-muted); }
.g-timeline li.done, .g-timeline li.cur { background: var(--bs-primary-light); border-color: transparent; color: var(--bs-primary); }
@media (max-width: 767.98px) { .g-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.g-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.g-photo-firma img { object-fit: contain; background: #fff; }
.g-firma-img { max-width: 260px; max-height: 110px; background: #fff; border: 1px solid var(--g-border); border-radius: 8px; padding: 4px; }
.g-etapa summary { cursor: pointer; list-style: none; }
.g-etapa summary::-webkit-details-marker { display: none; }
.g-etapa[data-vacia] summary { cursor: default; }
.g-opcion { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--g-border); border-radius: 10px; cursor: pointer; }
.g-opcion input { accent-color: var(--bs-primary); }
.g-opcion:has(input:checked) { border-style: solid; border-color: var(--bs-primary); background: var(--bs-primary-light); }
.g-opcion.no:has(input:checked) { border-color: var(--bs-danger); background: var(--bs-danger-light); }
