/* =====================================================================
   ScanDocumentos - estilo corporativo
   Compatible con Chrome antiguo (Android 7.1.1): sin variables CSS,
   sin flex-gap, sin grid. Pantallas pequenas: tipografia grande y
   objetivos tactiles amplios.
   Paleta: azul marino #14273e / azul corporativo #1a5fb4 / gris #eef1f5
   ===================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  font-size: 17px;
  color: #22262b;
  background: #eef1f5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

/* ============================ LOGIN ============================ */
.login-body {
  background: #14273e;
  background: linear-gradient(160deg, #16304e 0%, #101f33 60%, #0c1828 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-wrap { width: 100%; max-width: 400px; }

.brand {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}
.brand-mark {
  width: 54px;
  height: 54px;
  line-height: 54px;
  text-align: center;
  border-radius: 10px;
  background: #1a5fb4;
  background: linear-gradient(150deg, #2472d0, #164e94);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.brand-text { margin-left: 14px; }
.brand-title {
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.brand-sub {
  color: #8fa5c0;
  font-size: 13px;
  margin-top: 2px;
}

.panel {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0,0,0,0.4);
}
.panel-accent {
  height: 4px;
  background: #1a5fb4;
  background: linear-gradient(90deg, #2472d0, #1a5fb4 55%, #123f78);
}
.panel-body { padding: 24px 22px 26px; }
.panel-title {
  font-size: 17px;
  font-weight: 600;
  color: #14273e;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #5b6673;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 14px 0 6px;
}
input[type="text"], input[type="password"] {
  width: 100%;
  min-height: 52px;
  font-size: 19px;
  font-family: inherit;
  padding: 8px 12px;
  color: #22262b;
  border: 1px solid #c3ccd6;
  border-radius: 8px;
  background: #f7f9fb;
  -webkit-appearance: none;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: #1a5fb4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,95,180,0.15);
}

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
}
.btn-primary {
  background: #1a5fb4;
  background: linear-gradient(180deg, #2270cd, #1a5fb4);
  color: #fff;
  box-shadow: 0 3px 8px rgba(16,63,120,0.35);
}
.btn-primary:active { background: #164e94; }
.btn-primary:disabled { background: #7d99b8; box-shadow: none; }

.msg {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.msg.err  { background: #fdecea; color: #a4261a; border: 1px solid #f2b8b2; }
.msg.conn { background: #fef3e2; color: #92500a; border: 1px solid #f5cf8e; }

.login-footer {
  margin-top: 18px;
  text-align: center;
  color: #64788f;
  font-size: 12px;
  letter-spacing: 0.4px;
}

/* ============================ ESCANEO ============================ */
.scan-body {
  display: flex;
  flex-direction: column;
  background: #eef1f5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #14273e;
  background: linear-gradient(180deg, #1a3252, #14273e);
  color: #fff;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar-mark {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #1a5fb4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}
.topbar-title {
  margin-left: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; }
.topbar-user {
  font-size: 13px;
  color: #a9bcd4;
  margin-right: 10px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-ghost {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
}
.btn-ghost:active { background: rgba(255,255,255,0.22); }

.piloto-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-left: 5px solid #1a7d3c;
  border-bottom: 1px solid #d8dee6;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.piloto-info { min-width: 0; margin-right: 10px; }
.piloto-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #6a7a45;
  color: #55803e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.piloto-nombre {
  display: block;
  font-size: 17px;
  color: #14273e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-outline {
  min-height: 46px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #1a5fb4;
  background: #fff;
  border: 2px solid #1a5fb4;
  border-radius: 8px;
  white-space: nowrap;
}
.btn-outline:active { background: #e8f0fa; }

.scan-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 16px;
}

.scan-card {
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 12px;
  padding: 16px 14px;
  box-shadow: 0 2px 8px rgba(20,39,62,0.08);
}
.prompt {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  color: #14273e;
  margin-bottom: 12px;
}
.scan-field { position: relative; }
#scan {
  width: 100%;
  min-height: 56px;
  font-size: 20px;
  font-family: inherit;
  padding: 8px 12px;
  text-align: center;
  color: #14273e;
  border: 2px solid #1a5fb4;
  border-radius: 8px;
  background: #f4f8fd;
  -webkit-appearance: none;
}
#scan:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,95,180,0.18);
}

.resultado {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 18px 14px;
  border-radius: 12px;
  font-size: 25px;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(20,39,62,0.08);
}
.resultado.neutro {
  background: #fff;
  color: #7a8694;
  border: 1px dashed #c3ccd6;
  box-shadow: none;
  font-weight: 600;
}
.resultado.espera {
  background: #fff8e6;
  color: #8a6100;
  border: 1px solid #ecd28a;
}
.resultado.ok {
  background: #1a7d3c;
  background: linear-gradient(180deg, #1f9147, #1a7d3c);
  color: #fff;
}
.resultado.err {
  background: #b3261e;
  background: linear-gradient(180deg, #c62f26, #b3261e);
  color: #fff;
}
.resultado.conn {
  background: #d97706;
  background: linear-gradient(180deg, #e8850f, #d97706);
  color: #fff;
}
