/* ============================================================
   ITO GC — Estilos v2 · Tema claro · Azul/Verde institucional
   Tipografía: Courier Prime (mono) + DM Sans (cuerpo)
   Paleta: blanco · azul marino · verde esmeralda · gris suave
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Variables — tema claro ─────────────────────────────────── */
:root {
  /* Fondo y superficies */
  --bg:         #f4f6f9;
  --white:      #ffffff;
  --panel:      #ffffff;
  --panel-2:    #f0f4f8;
  --panel-3:    #e8eef5;

  /* Bordes */
  --border:     #d0dbe8;
  --border-2:   #b8c8d9;

  /* Azul marino institucional */
  --navy:       #0e2d5a;
  --navy-2:     #1a4280;
  --navy-3:     #2558a8;
  --navy-faint: rgba(14,45,90,.06);
  --navy-light: rgba(14,45,90,.12);

  /* Verde esmeralda */
  --green:      #0a7c52;
  --green-2:    #0d9e68;
  --green-3:    #10c07e;
  --green-faint:rgba(10,124,82,.07);
  --green-light:rgba(10,124,82,.15);

  /* Acento azul claro */
  --blue:       #1565c0;
  --blue-light: #e3eeff;

  /* Alertas */
  --red:        #c62828;
  --red-faint:  rgba(198,40,40,.08);
  --amber:      #e65100;
  --amber-faint:rgba(230,81,0,.08);

  /* Texto — más oscuro y legible en campo */
  --text-1:     #0a1628;
  --text-2:     #1e3352;
  --text-3:     #4a6580;

  /* Tipografías */
  --mono:       'Courier Prime', 'Courier New', monospace;
  --sans:       'DM Sans', system-ui, sans-serif;

  /* Forma */
  --radius:     6px;
  --radius-lg:  12px;
  --shadow:     0 1px 4px rgba(14,45,90,.08), 0 4px 16px rgba(14,45,90,.06);
  --shadow-lg:  0 4px 20px rgba(14,45,90,.12);

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
input, textarea, select, button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Layout principal ──────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  /* Móvil: ancho completo */
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

/* ── DESKTOP: 80% del ancho ────────────────────────────────── */
@media (min-width: 768px) {
  body {
    background: linear-gradient(135deg, #dce8f5 0%, #e8f4ee 50%, #dce8f5 100%);
    background-attachment: fixed;
  }
  #app {
    max-width: 80vw;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: 0 0 60px rgba(14,45,90,.15);
  }
  #bottom-nav {
    max-width: 80vw;
  }
  #toasts {
    max-width: calc(80vw - 32px);
  }
}

@media (min-width: 1200px) {
  #app { max-width: 75vw; }
  #bottom-nav { max-width: 75vw; }
}

/* ── Topbar ─────────────────────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 20px 10px;
  background: var(--navy);
  border-bottom: 3px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #ffffff;
}
.topbar-sub {
  font-size: 10px;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
  margin-top: 2px;
}
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.topbar-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── Contenido ─────────────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--safe-bottom) + 80px);
}

/* ── Screens ─────────────────────────────────────────────────  */
.screen { display: none; }
.screen.active { display: block; }
#screen-login.active { display: flex; }

/* ── LOGIN ──────────────────────────────────────────────────── */
#screen-login {
  padding: 40px 28px;
  flex-direction: column;
  min-height: calc(100dvh - 55px);
  background: linear-gradient(160deg, #f0f7ff 0%, #e8f5ee 100%);
}
.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.login-emblem {
  width: 80px;
  height: 80px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  box-shadow: 0 4px 20px rgba(14,45,90,.3);
}
.login-title {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .15em;
  color: var(--navy);
  text-transform: uppercase;
  font-weight: 700;
}
.login-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
  letter-spacing: .05em;
}
.login-warning {
  background: var(--red-faint);
  border: 1px solid rgba(198,40,40,.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 28px;
  line-height: 1.7;
  text-align: center;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ── SELECTOR ───────────────────────────────────────────────── */
#screen-selector { padding: 24px; }
.selector-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.ito-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

@media (min-width: 768px) {
  .ito-cards { flex-direction: row; gap: 14px; }
  .ito-card  { flex: 1; flex-direction: column; align-items: flex-start; }
  .ito-card-badge { margin-left: 0; margin-top: 12px; }
}

.ito-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: var(--shadow);
}
.ito-card:hover {
  border-color: var(--navy-3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.ito-card:active { transform: translateY(0); }
.ito-card-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--navy-faint);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-light);
}
.ito-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 3px;
}
.ito-card-desc { font-size: 12px; color: var(--text-3); }
.ito-card-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  border: 1.5px solid var(--green-2);
  padding: 2px 8px;
  border-radius: 3px;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: .08em;
}

.saved-section-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.saved-exp-btn {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all .15s;
  text-align: left;
}
.saved-exp-btn:hover { border-color: var(--navy-3); background: var(--blue-light); }
.exp-num  { font-family: var(--mono); font-size: 11px; color: var(--text-1); flex: 1; }
.exp-tipo { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .1em; }
.badge-vehiculo { background: var(--blue-light); color: var(--blue); }
.badge-interior { background: var(--amber-faint); color: var(--amber); }
.badge-exterior { background: var(--green-faint); color: var(--green); }
.exp-date { font-size: 10px; color: var(--text-3); }

/* ── EXPEDIENTE / FORMULARIO ────────────────────────────────── */
#screen-expediente { padding: 20px; }

@media (min-width: 768px) {
  #form-expediente .field-row { grid-template-columns: repeat(3, 1fr); }
}

.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row   { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-3);
  text-transform: uppercase;
}
.field-input {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  appearance: none;
}
.field-input:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px var(--navy-faint);
}
.field-textarea {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 13px;
  padding: 11px 13px;
  outline: none;
  width: 100%;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.7;
}
.field-textarea:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px var(--navy-faint);
}
select.field-input option { background: var(--white); color: var(--text-1); }

.section-divider {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--navy-2);
  text-transform: uppercase;
  border-top: 2px solid var(--border);
  padding-top: 14px;
  margin: 18px 0 12px;
  font-weight: 700;
}

/* ── INSPECCIÓN ─────────────────────────────────────────────── */
#screen-inspeccion { padding: 18px; }
#insp-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--navy);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,.7);
}
.zonas-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 18px 0 10px;
  font-weight: 700;
}
#zonas-list { display: flex; flex-direction: column; gap: 5px; }

@media (min-width: 768px) {
  #zonas-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}

.zona-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow);
}
.zona-btn:hover {
  border-color: var(--navy-3);
  background: var(--blue-light);
}
.zona-name { font-size: 13px; font-weight: 500; color: var(--text-1); flex: 1; }
.zona-stats { display: flex; gap: 6px; }
.stat-badge { font-size: 10px; padding: 2px 7px; border-radius: 3px; font-weight: 600; }
.stat-photo { background: var(--green-faint); color: var(--green); }
.stat-ind   { background: var(--amber-faint); color: var(--amber); }
.zona-arrow { color: var(--text-3); font-size: 18px; margin-left: auto; }

/* ── ZONA ───────────────────────────────────────────────────── */
#screen-zona { padding: 18px; }
.zona-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.back-btn {
  background: var(--panel-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  width: 38px; height: 38px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.back-btn:hover { border-color: var(--navy-3); color: var(--navy); background: var(--blue-light); }
#zona-title       { font-size: 15px; font-weight: 700; color: var(--navy); flex: 1; }
#zona-photo-count { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.subsection-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .15em;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

#zona-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
@media (min-width: 768px) {
  #zona-photos-grid { grid-template-columns: repeat(5, 1fr); }
}

.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--panel-2);
  transition: transform .15s;
}
.photo-thumb-wrap:hover { transform: scale(1.03); border-color: var(--navy-3); }
.photo-thumb { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(14,45,90,.8));
  padding: 5px 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.photo-num  { font-family: var(--mono); font-size: 8px; color: #fff; flex: 1; }
.ai-done    { font-size: 8px; color: #b8ffcc; }
.ai-edited  { font-size: 8px; color: #ffd580; }

.photo-add-btn {
  aspect-ratio: 1;
  background: var(--green-faint);
  border: 2px dashed var(--green-2);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  color: var(--green);
  transition: all .15s;
  font-weight: 600;
}
.photo-add-btn:hover { background: var(--green-light); border-color: var(--green); }
.add-icon { font-size: 22px; line-height: 1; }

.indicio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.indicio-codigo { font-family: var(--mono); font-size: 11px; color: var(--navy); font-weight: 700; flex-shrink: 0; }
.indicio-tipo   { font-size: 10px; color: var(--text-3); flex-shrink: 0; min-width: 48px; }
.indicio-desc   { font-size: 12px; color: var(--text-2); flex: 1; }
.indicio-del {
  background: none; border: none; color: var(--border-2);
  cursor: pointer; font-size: 14px; padding: 4px;
  transition: color .15s;
}
.indicio-del:hover { color: var(--red); }

/* ── FOTO ───────────────────────────────────────────────────── */
#screen-photo { padding: 18px; }
.photo-view-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel-2);
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
#photo-view-img { width: 100%; max-height: 340px; object-fit: contain; }

.photo-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.photo-meta-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
}
.photo-meta-label { font-size: 9px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.photo-meta-val   { font-family: var(--mono); font-size: 11px; color: var(--text-1); margin-top: 3px; word-break: break-all; }

.ai-status {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: .06em;
  margin-bottom: 10px;
  font-weight: 700;
}
.ai-pending { background: var(--panel-3); color: var(--text-3); }
.ai-loading { background: var(--amber-faint); color: var(--amber); }
.ai-done    { background: var(--green-faint); color: var(--green); }
.ai-error   { background: var(--red-faint);  color: var(--red); }

#photo-ai-text {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.8;
  padding: 13px;
  width: 100%;
  min-height: 160px;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#photo-ai-text:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px var(--navy-faint);
}
.photo-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
@media (min-width: 768px) {
  .photo-actions { flex-direction: row; }
}

/* ── INFORME ─────────────────────────────────────────────────── */
#screen-informe { padding: 18px; }
#informe-preview {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.informe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 18px;
}
.informe-logo {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  line-height: 2;
  color: var(--text-2);
}
.informe-num  { font-family: var(--mono); font-size: 13px; color: var(--navy); text-align: right; font-weight: 700; }
.informe-tipo { font-size: 10px; color: var(--text-3); text-align: right; margin-top: 3px; }

.informe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 18px;
}
.informe-table th, .informe-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.informe-table th { color: var(--text-3); font-size: 10px; letter-spacing: .06em; background: var(--panel-2); font-weight: 700; }
.td-label { color: var(--text-3); font-size: 11px; white-space: nowrap; width: 130px; font-weight: 600; }

.informe-section {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--navy);
  text-transform: uppercase;
  border-top: 2px solid var(--border);
  padding: 14px 0 0;
  margin: 20px 0 12px;
  font-weight: 700;
}
.informe-text { font-size: 13px; color: var(--text-2); line-height: 1.8; }

.informe-photo-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.informe-photo-header {
  background: var(--navy);
  padding: 8px 14px;
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: rgba(255,255,255,.75);
  flex-wrap: wrap;
}
.informe-hash { font-family: var(--mono); font-size: 9px; color: rgba(255,255,255,.45); margin-left: auto; }
.informe-photo-img { width: 100%; max-height: 260px; object-fit: contain; background: var(--panel-2); }
.informe-photo-text { padding: 14px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.informe-edited-badge {
  margin: 0 14px 12px;
  display: inline-block;
  padding: 3px 10px;
  border: 1.5px solid var(--green);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--green);
  letter-spacing: .1em;
  font-weight: 700;
}

.changelog-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--mono);
  font-size: 10px;
}
.cl-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 80px;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
@media (max-width: 500px) {
  .cl-row { grid-template-columns: 1fr 1fr; }
  .cl-hash { display: none; }
}
.cl-ts     { color: var(--text-3); }
.cl-action { color: var(--navy-2); font-weight: 700; }
.cl-detail { color: var(--text-2); }
.cl-hash   { color: var(--text-3); font-size: 9px; }

.informe-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── BOTONES ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14,45,90,.25);
}
.btn-primary:hover { background: var(--navy-2); box-shadow: 0 4px 14px rgba(14,45,90,.3); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(10,124,82,.2);
}
.btn-secondary:hover { background: var(--green-2); }

.btn-ghost {
  background: var(--panel-2);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--navy-3); color: var(--navy); background: var(--blue-light); }

.btn-danger {
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid rgba(198,40,40,.3);
}
.btn-danger:hover { background: rgba(198,40,40,.15); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-icon { font-size: 15px; }

/* ── BOTTOM NAV ─────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-top: 2px solid var(--border);
  padding: 8px 16px calc(var(--safe-bottom) + 8px);
  display: flex;
  gap: 6px;
  box-shadow: 0 -4px 20px rgba(14,45,90,.08);
}
.nav-btn {
  flex: 1;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-3);
}
.nav-btn:hover, .nav-btn.active {
  border-color: var(--navy-3);
  color: var(--navy);
  background: var(--blue-light);
}
.nav-icon  { font-size: 18px; line-height: 1; }
.nav-label { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,45,90,.4);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal-card { border-radius: var(--radius-lg); max-width: 500px; }
}
.modal-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 20px;
  font-weight: 700;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ── TOASTS ─────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  top: calc(var(--safe-top) + 65px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
}
.toast {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(-8px);
  transition: all .25s;
  box-shadow: var(--shadow-lg);
}
.toast.show  { opacity: 1; transform: translateY(0); }
.toast-ok    { border-color: var(--green-2); color: var(--green); background: var(--green-faint); }
.toast-error { border-color: rgba(198,40,40,.4); color: var(--red); background: var(--red-faint); }

/* ── UTILIDADES ─────────────────────────────────────────────── */
.font-mono { font-family: var(--mono) !important; letter-spacing: .05em; }
.empty-msg { font-size: 13px; color: var(--text-3); padding: 24px 0; text-align: center; }
.demo-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-family: var(--mono);
  font-size: 80px;
  font-weight: 700;
  color: rgba(14,45,90,.04);
  pointer-events: none;
  z-index: 0;
  letter-spacing: .4em;
  user-select: none;
  white-space: nowrap;
}

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
  #topbar, #bottom-nav, .topbar-actions, .informe-actions, .back-btn { display: none !important; }
  body, #app { background: white; box-shadow: none; }
  #informe-preview { border: none; box-shadow: none; padding: 0; }
  #screen-informe { padding: 0; }
}

/* ── Animación entrada ──────────────────────────────────────── */
.screen.active { animation: screenIn .2s ease-out; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   COMPONENTES ADICIONALES v2 — Pestañas y expediente
════════════════════════════════════════════════════════════ */

/* ── Selector ────────────────────────────────────────────── */
.selector-wrap { padding: 24px; max-width: 900px; margin: 0 auto; }
.selector-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  color: var(--text-3); text-transform: uppercase; margin-bottom: 18px; font-weight: 700;
}
.ito-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
@media (min-width: 600px) { .ito-cards { flex-direction: row; } }
.ito-card {
  flex: 1; background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 16px;
  cursor: pointer; transition: all .2s; display: flex;
  flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; box-shadow: var(--shadow); position: relative;
}
.ito-card:hover { border-color: var(--navy-3); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ito-icon { font-size: 28px; margin-bottom: 6px; }
.ito-name { font-weight: 700; font-size: 14px; color: var(--navy); }
.ito-desc { font-size: 12px; color: var(--text-3); }
.ito-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--mono); font-size: 10px; color: var(--green);
  border: 1.5px solid var(--green-2); padding: 2px 7px;
  border-radius: 3px; font-weight: 700; letter-spacing: .08em;
}

/* Expedientes recientes */
.saved-section { margin-top: 8px; }
.saved-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--text-3); text-transform: uppercase; font-weight: 700;
  margin-bottom: 10px; padding-top: 20px; border-top: 1px solid var(--border);
}
.saved-btn {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 14px; display: flex;
  align-items: center; gap: 10px; cursor: pointer; margin-bottom: 6px;
  transition: all .15s; text-align: left;
}
.saved-btn:hover { border-color: var(--navy-3); background: var(--blue-light); }
.saved-num  { font-family: var(--mono); font-size: 12px; color: var(--text-1); flex: 1; }
.saved-tipo { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; }
.tipo-vehiculo { background: var(--blue-light); color: var(--blue); }
.tipo-interior { background: var(--amber-faint); color: var(--amber); }
.tipo-exterior { background: var(--green-faint); color: var(--green); }
.saved-date   { font-size: 10px; color: var(--text-3); }
.saved-arrow  { color: var(--text-3); font-size: 16px; }

/* ── Topbar expediente ───────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--navy);
  border-bottom: 3px solid var(--green);
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap; gap: 8px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-title { font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.topbar-sub   { font-size: 10px; color: rgba(255,255,255,.5); }
.topbar-btns  { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-tag     { color: var(--green-3); font-size: 10px; }
.agent-badge  { font-size: 11px; color: rgba(255,255,255,.7); font-family: var(--mono); padding: 0 4px; }

.btn-topbar {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85); padding: 6px 12px; border-radius: var(--radius);
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.btn-topbar:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn-save  { background: #e8f5e9; color: #1b5e20; border: none; padding: 6px 12px; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-print { background: #e8f0fe; color: var(--blue); border: none; padding: 6px 12px; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-sm    { padding: 5px 10px !important; font-size: 11px !important; }
.btn-outline { background: none; border: 1.5px solid var(--border); color: var(--text-2); padding: 5px 10px; border-radius: var(--radius); font-size: 11px; cursor: pointer; }
.btn-outline:hover { border-color: var(--navy-3); color: var(--navy); }

/* ── PESTAÑAS ────────────────────────────────────────────── */
.tabs-wrap {
  display: flex; overflow-x: auto; background: var(--white);
  border-bottom: 2px solid var(--border);
  position: sticky; top: 52px; z-index: 90;
  scrollbar-width: none; gap: 0;
}
.tabs-wrap::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: 12px 16px; background: none;
  border: none; border-bottom: 3px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer;
  color: var(--text-2); transition: all .15s; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.tab-btn:hover  { color: var(--navy); background: var(--panel-2); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); background: var(--blue-light); }
.tab-badge {
  background: var(--navy); color: #fff;
  font-size: 9px; font-weight: 700; padding: 1px 5px;
  border-radius: 10px; margin-left: 2px;
}
.tab-badge.green { background: var(--green); }

/* ── PÁGINAS DE PESTAÑAS ─────────────────────────────────── */
.tab-pages { flex: 1; overflow-y: auto; }
.tab-page  { display: none; }
.tab-page.active { display: block; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tab-card {
  padding: 20px; max-width: 900px; margin: 0 auto;
}
@media (min-width: 768px) { .tab-card { padding: 24px 32px; } }

.tab-hint { font-size: 12px; color: var(--text-3); margin-bottom: 16px; line-height: 1.6; }

/* ── Secciones del formulario ────────────────────────────── */
.sec-header {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .15em; color: var(--navy);
  text-transform: uppercase; border-left: 3px solid var(--navy);
  padding-left: 10px; margin: 0 0 16px;
}
.sec-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}

/* ── Fields ──────────────────────────────────────────────── */
.field-group   { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field-row     { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.flex1 { flex: 1 1 80px; min-width: 80px; }
.flex2 { flex: 2 1 120px; min-width: 120px; }
.flex3 { flex: 3 1 180px; min-width: 180px; }
.f-label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  color: var(--navy); text-transform: uppercase;
}
.f-input {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text-1);
  font-size: 15px; font-weight: 500; padding: 10px 12px; outline: none;
  width: 100%; appearance: none; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.f-input:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--navy-faint); }
.f-input::placeholder { color: var(--text-3); font-weight: 400; }
.f-textarea {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text-1);
  font-size: 14px; font-weight: 500; padding: 10px 12px; outline: none; width: 100%;
  resize: vertical; line-height: 1.7; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.f-textarea:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--navy-faint); }
.f-textarea::placeholder { color: var(--text-3); font-weight: 400; }
select.f-input option { background: var(--white); color: var(--text-1); }
.mono { font-family: var(--mono) !important; letter-spacing: .04em; }

/* ── Zonas inspección ────────────────────────────────────── */
.zonas-list { display: flex; flex-direction: column; gap: 4px; }
.zona-item {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--white); transition: border-color .15s;
}
.zona-item.zona-filled { border-color: var(--green-2); }
.zona-item-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer; background: var(--panel-2);
  transition: background .15s;
}
.zona-item-header:hover { background: var(--blue-light); }
.zona-filled .zona-item-header { background: var(--green-faint); }
.zona-item-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-1); }
.badge-foto { background: var(--green-faint); color: var(--green); font-size: 10px; padding: 2px 7px; border-radius: 3px; font-weight: 600; }
.zona-arrow { color: var(--text-3); font-size: 16px; transition: transform .15s; }
.zona-item-body { padding: 12px 14px; border-top: 1px solid var(--border); }
.zona-item-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ── Indicios ────────────────────────────────────────────── */
.indicios-table-wrap { overflow-x: auto; }
.indicios-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.indicios-table th {
  background: var(--panel-2); color: var(--text-3);
  font-size: 10px; letter-spacing: .06em; text-align: left;
  padding: 8px 10px; border-bottom: 2px solid var(--border);
}
.indicios-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.td-zona { color: var(--text-3); font-size: 11px; }
.btn-icon-del {
  background: none; border: none; color: var(--border-2);
  cursor: pointer; font-size: 14px; padding: 2px 4px;
  transition: color .15s;
}
.btn-icon-del:hover { color: var(--red); }

/* ── Fotos ───────────────────────────────────────────────── */
.foto-btns-global {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 20px;
}
.foto-add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-foto-camera {
  flex: 1; background: var(--navy); color: #fff; border: none;
  border-radius: var(--radius); padding: 12px 16px; font-size: 14px;
  font-weight: 700; cursor: pointer; min-width: 140px;
  transition: background .15s;
}
.btn-foto-camera:hover { background: var(--navy-2); }
.btn-foto-gallery {
  flex: 1; background: var(--green); color: #fff; border: none;
  border-radius: var(--radius); padding: 12px 16px; font-size: 14px;
  font-weight: 700; cursor: pointer; min-width: 140px;
  transition: background .15s;
}
.btn-foto-gallery:hover { background: var(--green-2); }
.foto-hint { font-size: 11px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }

.zona-fotos-section { margin-bottom: 20px; }
.zona-fotos-title {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--navy); letter-spacing: .08em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.foto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (min-width: 600px) { .foto-grid { grid-template-columns: repeat(6, 1fr); } }
.foto-thumb-wrap {
  aspect-ratio: 1; cursor: pointer; border-radius: var(--radius);
  overflow: hidden; border: 1.5px solid var(--border); background: var(--panel-2);
  position: relative; transition: transform .15s;
}
.foto-thumb-wrap:hover { transform: scale(1.04); border-color: var(--navy-3); }
.foto-thumb { width: 100%; height: 100%; object-fit: cover; }
.foto-thumb-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(14,45,90,.8));
  padding: 4px 5px; display: flex; gap: 3px; align-items: center;
}
.ai-ok   { font-size: 8px; color: #b8ffcc; font-weight: 700; }
.ai-edit { font-size: 8px; color: #ffd580; }

/* Modal foto */
.foto-meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.foto-meta-item { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.ai-status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 3px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.ai-pending { background: var(--panel-3); color: var(--text-3); }
.ai-loading { background: var(--amber-faint); color: var(--amber); }
.ai-done    { background: var(--green-faint); color: var(--green); }
.ai-error   { background: var(--red-faint); color: var(--red); }

/* ── Copy button ─────────────────────────────────────────── */
.copy-row { margin-top: 12px; }
.copy-btn {
  background: var(--navy-faint); border: 1.5px solid var(--navy-light);
  color: var(--navy); padding: 9px 16px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.copy-btn:hover { background: var(--blue-light); border-color: var(--navy-3); }
.copy-sm { padding: 5px 10px; font-size: 11px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(14,45,90,.45);
  z-index: 200; display: none; align-items: flex-end;
  justify-content: center; backdrop-filter: blur(4px);
}
@media (min-width: 600px) {
  .modal-wrap { align-items: center; }
  .modal-inner { border-radius: var(--radius-lg) !important; max-width: 560px; }
}
.modal-inner {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; color: var(--navy); text-transform: uppercase;
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.modal-footer {
  display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-el {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 11px 20px;
  border-radius: 24px; font-size: 13px; font-weight: 600;
  opacity: 0; transition: all .25s; z-index: 500; white-space: nowrap;
  box-shadow: var(--shadow-lg); pointer-events: none;
}
.toast-el.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok    { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info  { background: var(--navy-2); }

/* ── Informe ─────────────────────────────────────────────── */
.informe-body { }
.inf-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 16px; border-bottom: 2px solid var(--navy); margin-bottom: 16px;
}
.inf-logo-block { display: flex; align-items: center; gap: 12px; }
.inf-escudo {
  width: 50px; height: 50px; background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
}
.inf-org-name { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--navy); letter-spacing: .1em; }
.inf-org-sub  { font-size: 10px; color: var(--text-3); }
.inf-num      { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--navy); text-align: right; }
.inf-tipo-tag { font-size: 10px; color: var(--text-3); text-align: right; }
.inf-table    { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
.inf-table th, .inf-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); text-align: left; }
.inf-table th { background: var(--panel-2); color: var(--text-3); font-size: 10px; }
.inf-td-lbl   { color: var(--text-3); font-size: 11px; white-space: nowrap; width: 120px; font-weight: 600; }
.inf-sec      {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .15em; color: var(--navy); text-transform: uppercase;
  border-top: 1.5px solid var(--border); padding-top: 14px;
  margin: 18px 0 10px;
}
.inf-text     { font-size: 13px; color: var(--text-2); line-height: 1.8; }
.inf-foto-block { border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.inf-foto-header { background: var(--navy); padding: 7px 12px; display: flex; gap: 12px; font-size: 11px; color: rgba(255,255,255,.75); flex-wrap: wrap; }
.inf-hash     { font-family: var(--mono); font-size: 9px; color: rgba(255,255,255,.4); margin-left: auto; }
.inf-foto-img { width: 100%; max-height: 240px; object-fit: contain; background: var(--panel-2); }
.inf-foto-text { padding: 12px; font-size: 12px; line-height: 1.8; color: var(--text-2); }
.inf-certified { margin: 0 12px 10px; display: inline-block; padding: 3px 10px; border: 1.5px solid var(--green); border-radius: 3px; font-family: var(--mono); font-size: 9px; color: var(--green); font-weight: 700; }
.inf-changelog { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-family: var(--mono); font-size: 10px; }
.cl-row { display: grid; grid-template-columns: 90px 1fr 1fr 80px; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--text-3); }
.cl-ts  { color: var(--text-3); }
.cl-act { color: var(--navy-2); font-weight: 700; }
.cl-det { color: var(--text-2); }
.cl-hash { color: var(--text-3); font-size: 9px; }

/* ── Login (override con tema claro) ────────────────────── */
#screen-login {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #eef4ff 0%, #e8f5ee 100%);
}
.login-box {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 28px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px;
}
.login-emblem {
  width: 64px; height: 64px; background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin: 0 auto 4px; box-shadow: 0 4px 20px rgba(14,45,90,.3);
}
.login-title { font-family: var(--mono); font-size: 14px; letter-spacing: .18em; color: var(--navy); text-transform: uppercase; font-weight: 700; text-align: center; }
.login-sub   { font-size: 11px; color: var(--text-3); text-align: center; margin-top: -8px; }
.login-warning { background: var(--red-faint); border: 1px solid rgba(198,40,40,.25); border-radius: var(--radius); padding: 10px 14px; font-size: 11px; color: var(--red); line-height: 1.7; text-align: center; }

/* ── Botones generales ───────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; white-space: nowrap; }
.btn-primary   { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(14,45,90,.2); }
.btn-primary:hover { background: var(--navy-2); }
.btn-secondary { background: var(--green); color: #fff; }
.btn-secondary:hover { background: var(--green-2); }
.btn-ghost     { background: var(--panel-2); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--navy-3); color: var(--navy); }
.btn-danger    { background: var(--red-faint); color: var(--red); border: 1px solid rgba(198,40,40,.3); }
.btn-danger:hover { background: rgba(198,40,40,.15); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Utilidades ──────────────────────────────────────────── */
.empty-msg { font-size: 13px; color: var(--text-3); padding: 24px 0; text-align: center; }
.demo-watermark {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-35deg);
  font-family: var(--mono); font-size: 80px; font-weight: 700;
  color: rgba(14,45,90,.04); pointer-events: none; z-index: 0;
  letter-spacing: .4em; user-select: none; white-space: nowrap;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .topbar, .tabs-wrap, .btn, .copy-btn, .foto-btns-global { display: none !important; }
  .tab-page { display: none !important; }
  #tabpage-6 { display: block !important; }  /* pestaña informe */
  body { background: white; }
}

/* ── Desktop 80% ─────────────────────────────────────────── */
@media (min-width: 768px) {
  body { background: linear-gradient(135deg, #dce8f5 0%, #e8f4ee 50%, #dce8f5 100%) fixed; }
  #screen-login    { min-height: 100vh; }
  #screen-selector,
  #screen-expediente { max-width: 80vw; margin: 0 auto; min-height: 100dvh; background: var(--white); box-shadow: 0 0 60px rgba(14,45,90,.12); }
}
@media (min-width: 1200px) {
  #screen-selector,
  #screen-expediente { max-width: 75vw; }
}

/* ════════════════════════════════════════════════════════════
   MAPA GOOGLE MAPS + GPS
════════════════════════════════════════════════════════════ */
.map-input-row {
  display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap;
}
.map-input-row .f-input { flex: 1; min-width: 160px; }

.btn-map {
  background: var(--navy); color: #fff; border: none;
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.btn-map:hover { background: var(--navy-2); }

.btn-gps {
  background: var(--green); color: #fff; border: none;
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.btn-gps:hover { background: var(--green-2); }

.map-wrap {
  margin-top: 10px; border-radius: var(--radius-lg);
  overflow: hidden; border: 1.5px solid var(--navy-light);
  box-shadow: var(--shadow);
}
.map-frame {
  width: 100%; height: 260px; display: block; border: none;
}
.map-frame-lg { height: 320px; }

.map-close-btn {
  display: block; width: 100%; background: var(--panel-2);
  border: none; border-top: 1px solid var(--border);
  padding: 9px 16px; font-size: 12px; font-weight: 600;
  color: var(--text-2); cursor: pointer; text-align: center;
  transition: background .15s;
}
.map-close-btn:hover { background: var(--border); color: var(--text-1); }

@media (min-width: 600px) {
  .map-frame { height: 320px; }
  .map-frame-lg { height: 400px; }
}

/* ── Aumentar peso general de textos del informe ─────────── */
.inf-text { font-size: 14px; color: var(--text-1); line-height: 1.8; font-weight: 500; }
.inf-foto-text { padding: 12px; font-size: 13px; line-height: 1.8; color: var(--text-1); font-weight: 500; }
.inf-td-lbl { color: var(--navy); font-size: 12px; font-weight: 700; }
.inf-table td { font-size: 13px; font-weight: 500; color: var(--text-1); }
.zona-item-name { font-size: 14px; font-weight: 600; color: var(--text-1); flex: 1; }
.tab-hint { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.6; font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   CROQUIS IA
════════════════════════════════════════════════════════════ */
.croquis-upload-box {
  border: 2px dashed var(--navy-light);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  background: var(--navy-faint);
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 14px;
}
.croquis-upload-box.dz-over {
  border-color: var(--navy-3);
  background: var(--blue-light);
}
.croquis-drop-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  margin: 10px 0 4px;
}
.croquis-drop-hint {
  font-size: 12px; color: var(--text-3); margin: 0;
}
.croquis-btns {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.croquis-thumbs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.croquis-thumb-item {
  position: relative; width: 72px; height: 72px;
  border-radius: var(--radius); overflow: hidden;
  border: 1.5px solid var(--border);
}
.croquis-thumb-img {
  width: 100%; height: 100%; object-fit: cover;
}
.croquis-thumb-del {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.65); color: #fff;
  border: none; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.croquis-count {
  font-size: 12px; color: var(--text-3); margin: 0 0 12px;
}

/* Barra de progreso */
.croquis-prog-bar-wrap {
  background: var(--panel-3); border-radius: 6px;
  height: 10px; overflow: hidden; margin-bottom: 8px;
}
.croquis-prog-bar {
  background: var(--navy); height: 100%;
  border-radius: 6px; width: 0%;
  transition: width .6s ease;
}
.croquis-prog-msg {
  font-size: 13px; font-weight: 600; color: var(--navy); margin: 0;
}

/* Resultado del croquis */
.croquis-result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--green-faint);
  border: 1.5px solid var(--green-2); border-radius: var(--radius);
  margin-bottom: 12px; font-size: 13px; font-weight: 700;
  color: var(--green); flex-wrap: wrap; gap: 8px;
}
.croquis-svg-wrap {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  overflow: auto; background: #f8f7f4;
  margin-bottom: 14px;
}
.croquis-svg-wrap svg {
  max-width: 100%; height: auto; display: block;
}
.croquis-svg-wrap:fullscreen,
.croquis-svg-wrap:-webkit-full-screen {
  background: #1e3a5f; display: flex;
  align-items: center; justify-content: center;
}
.croquis-analysis {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  font-size: 13px; color: var(--text-1); line-height: 1.8;
  font-weight: 500;
}

/* Destino badge en indicios */
.destino-badge {
  display: inline-block; background: var(--navy-faint);
  color: var(--navy); border: 1px solid var(--navy-light);
  border-radius: 3px; padding: 2px 7px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}

/* Croquis en informe */
.inf-croquis-wrap {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #f8f7f4; margin-bottom: 12px;
}
.inf-croquis-wrap svg {
  max-width: 100%; height: auto; display: block;
}
.inf-croquis-analysis {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  font-size: 12px; color: var(--text-2); line-height: 1.8;
  margin-bottom: 4px;
}
